system-image-node-module

UBports System image client/server module


Keywords
node-module, system-image
License
GPL-3.0
Install
npm install system-image-node-module@1.1.3

Documentation

System image node module

Build Status Coverage Status

Client

Access a system-image server http endpoint

Example:

const systemImageClient = require("./src/module.js").Client;
const systemImage = new systemImageClient();

systemImage.getDeviceChannels("bacon").then((channels) => console.log(channels));

const progress = (progress, speed) => {
  console.log("progress:", progress*100, "%");
  console.log("speed:", speed, "MB/s");
}

const next = (downloadedFiles, totalFiles) => {
  console.log("file", downloadedFiles, "/", totalFiles);
}

systemImage.downloadLatestVersion({device: "bacon", channel: "ubports-touch/16.04/stable"}, progress, next).then(() => { console.log("done"); });

The constructor takes an object with optional properties as an argument. The default properties are listed below.

{
  host: "https://system-image.ubports.com/", // URL of the system-image server
  path: "./test",                            // download path
  allow_insecure: false                      // allow unencrypted URL
  cache_time: 180                            // time to keep cached files
}

Server

Maintain a system-image server backend (not implemented yet)