Nonviolent Pigeon Manifestation

    marshall-code-api
    TypeScript icon, indicating that this package has built-in type declarations

    0.5.12 • Public • Published

    nodejs

    import { codeApi } from 'marshall-code-api';
    
    codeApi.onConnected = (connected) => {
        console.log(`CODE is ${connected ? 'Connected' : 'Disconnected'}`);
        if (connected) {
            codeApi.requestCurrentPreset();
        }
    };
    codeApi.onPresetNumberChanged = (number) => {
        console.log(`Preset number changed to ${number}`);
        codeApi.requestPreset(number);
    };
    codeApi.onPresetModified = (changes) => {
        console.log('Preset changed', changes);
    };
    codeApi.onPresetUpdated = (index) => {
        console.log(`Preset #${index} updated`);
    };
    codeApi.onCurrentPresetReceived = (preset) => {
        console.log('Preset loaded', preset);
    };
    
    await codeApi.init();
    
    codeApi.switchToPreset(2);

    Install

    npm i marshall-code-api

    DownloadsWeekly Downloads

    2

    Version

    0.5.12

    License

    ISC

    Unpacked Size

    44.5 kB

    Total Files

    12

    Last publish

    Collaborators

    • tsydd