thingsSDK Deployer
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);
deployer.use('microjs', (devices, payload, next) => {
someTranspileFunction(payload.entry, (err, code) => {
payload.code = code;
next();
});
});
deployer.use('microjs', (devices, payload, next) => {
someUploadFunction(devices, payload.code, (err) => {
next();
});
});
deployer.deploy();
Current Strategies