resin-device-init
Configure and initialize devices using device specs.
Role
The intention of this module is to provide low level access to how Resin.io configures and initialises devices using device specs.
THIS MODULE IS LOW LEVEL AND IS NOT MEANT TO BE USED BY END USERS DIRECTLY.
Installation
Install resin-device-init
by running:
$ npm install --save resin-device-init
Documentation
- init
- .configure(image, device, config, [options]) ⇒
Promise.<EventEmitter>
- .initialize(image, deviceType, options) ⇒
Promise.<EventEmitter>
- .configure(image, device, config, [options]) ⇒
Promise.<EventEmitter>
init.configure(image, device, config, [options]) ⇒ This function injects config.json
and network settings into the device.
Kind: static method of init
Summary: Configure an image with an application
Returns: Promise.<EventEmitter>
- configuration event emitter
Access: public
Param | Type | Description |
---|---|---|
image | String |
path to image |
device | String |
type - device type slug |
config | Object |
a fully populated config object |
[options] | Object |
configuration options |
Example
init -> configuration configuration configurationon 'state' state -> console console configurationon 'error' error -> throw error configurationon 'end' -> console
Promise.<EventEmitter>
init.initialize(image, deviceType, options) ⇒ Kind: static method of init
Summary: Initialize an image
Returns: Promise.<EventEmitter>
- initialization event emitter
Access: public
Param | Type | Description |
---|---|---|
image | String |
path to image |
deviceType | String |
device type slug |
options | Object |
configuration options |
Example
init -> configuration configuration configurationon 'state' state -> console console configurationon 'burn' state -> console configurationon 'error' error -> throw error configurationon 'end' -> console
Support
If you're having any problem, please raise an issue on GitHub and the Resin.io team will be happy to help.
Tests
Create an .env
file and put the following lines in it, replacing the asterisks
with the valid credentials for a test user on resinstaging.io
RESIN_E2E_EMAIL=***
RESIN_E2E_PASSWORD=***
Run the test suite by doing:
$ npm test
Contribute
- Issue Tracker: github.com/resin-io/resin-device-init/issues
- Source Code: github.com/resin-io/resin-device-init
Before submitting a PR, please make sure that you include tests, and that coffeelint runs without any warning:
$ gulp lint
You can then run the tests with:
npm test
License
The project is licensed under the Apache 2.0 license.