Create a NPM module
You can easily create a npm module with System Designer.
Configure your Github repository
- go to Github,
- create a repository to store your npm module,
- go to the Personal Access Tokens page,
- click on Generate new token button,
- in Token Description type 'System Designer',
- add repo scope,
- click on Generate token button and
- copy the generated key.
Configure System Designer
- open the configuration panel,
- in Github token paste your key,
- in Github repository set the name of your repository (example: myname/myrepo ) and
- click on 'Save' button.
Create your module
- once you have created your system, open the Github panel,
- add a comment,
- click on Add a package.json file,
- click on Execute button and
- your system will be pushed in your Github repository with a package.json.
Publish your module
To publish your module:
- clone your repository and
- go to this documentation.
Use your module
First, you need to install System Runtime server-side:
npm install system-runtime --save
Install your module:
npm install mysystem --save
Then create a new file (mysystem.js for example) and call the install method of runtime:
const runtime = require('system-runtime');
// install and start the system
runtime.install('mysystem');