nachos-api
v1.0.1
Published
The API to interact with nachos
Downloads
6
Readme
nachos-api
API to interact with nachos core
Have a problem? Come chat with us!
Installation
$ [sudo] npm install nachos-api --save
Usage
Initialization
var nachosApi = require('nachos-api');
Custom events
on(packageName, callback)
Register custom events
nachosApi.on('your-package', function () {
// Code to execute on event custom.your-package
});
emit(packageName, data)
Emit custom event
nachosApi.emit('your-package', { ... }); // -> emits custom.your-package with the sent data
removeListener(packageName, callback)
Remove event listener
nachosApi.removeListener('your-package', cb); // cb -> The callback used on registration
Settings
Example
nachosApi.settings('your-package')
.save({ ... })
.then(function () {
// Saved data successfully
});
See settings-file documentation to see list of available functions
Server
Examples
nachosApi.server.users.me()
.then(function (user) {
// user -> your user data
});
See server-api documentation to see list of available functions
System
open(data)
nachosApi.system.open('path/to/file')
.then(function () {
// Opened successfully
});
Run Tests
$ npm test