nachos-api

1.0.1 • Public • Published

nachos-api

API to interact with nachos core

Linux OSX Windows Coverage Dependencies DevDependencies
Coverage Status

Have a problem? Come chat with us!

Join the chat at https://gitter.im/nachos/nachos-api

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

License

MIT

Readme

Keywords

Package Sidebar

Install

npm i nachos-api

Weekly Downloads

0

Version

1.0.1

License

MIT

Last publish

Collaborators

  • amirschl
  • noamokman
  • omrilitov
  • eladbezalel