Skip to content

Deploys JavaScript code to microcontrollers using build and upload strategies

Notifications You must be signed in to change notification settings

thingsSDK/thingssdk-deployer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

thingsSDK Deployer

Build Status codecov Dependency Status devDependency Status

Deploys JavaScript code to microcontrollers using build and upload strategies.

Installation

$ npm install thingssdk-deployer

Example Code

If you have you're own JavaScript runtime and you want to build you're own deployment strategy here's an example way

const devices = {
    devices: {
        COM7: {
            runtime: "microjs",
            baud_rate: 115200
        }
    }
};

const payload: {
    entry: "index.js"
};

const createDeployer = require('thingssdk-deployer');
const deployer = createDeployer();

deployer.prepare(devices, payload);
//Build Process
deployer.use('microjs', (devices, payload, next) => {
    someTranspileFunction(payload.entry, (err, code) => {
        payload.code = code;
        next();
    });
});
//Upload Process
deployer.use('microjs', (devices, payload, next) => {
    someUploadFunction(devices, payload.code, (err) => {
        next();
    });
});

deployer.deploy();

Current Strategies

About

Deploys JavaScript code to microcontrollers using build and upload strategies

Resources

Stars

Watchers

Forks

Packages

No packages published