You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
parttimejob/node_modules/sdk-base
侯晓宇 0cb2601919
init
1 month ago
..
History.md init 1 month ago
README.md init 1 month ago
index.js init 1 month ago
package.json init 1 month ago

README.md

sdk-base

NPM version build status Test coverage Gittip David deps npm download

A base class for sdk with default error handler.

Installation

$ npm install sdk-base

Usage

var Base = require('sdk-base');
var util = require('util');

function Client() {
  Base.call(this);
}

util.inherits(Client, Base);

API

  • .ready(flagOrFunction)

    // init ready
    client.ready(true);
    // listen client ready
    client.ready(function() {
      console.log('client is ready');
    });
    
  • .on(event, listener)

    // listen error event
    client.on('error', function(err) {
      console.error(err.stack);
    });
    

License

MIT