Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including node-hooks-events with all npm packages installed. Try it out:

var nodeHooksEvents = require("node-hooks-events")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

node-hooks-events v0.0.31

Hooks events http://hooks.events/ node client

node-hooks

npm version Build Status

NPM

node wrapper for http://hooks.events

GET your copy of hooks.events on the site

INSTALL

npm install node-hooks-events -save

USAGE

var Hooks = require('node-hooks-events');

var hooks = new Hooks(appKey); //fill with given appkey from the app

// or if is an array of Api Keys
var hooks = new Hooks([
  appKey_1,
  appKey_2,
  ...
]);

send a message

hooks.send('title', 'message', callback(err,response));

that's it

Responses

If there is an error:

  err: <message>,
  {
    hooksTitle: '<title>',
    hooksMessage: '<message>',
    hookID: '<uuid of the hook request>',
    hooksApi: '<ref to appKey>',
    sent: false
  }

If request is ok:

  err:null,
  {
    hooksTitle: '<title>',
    hooksMessage: '<message>',
    hookID: '<uuid of the hook request>',
    hooksApi: '<ref to appKey>',
    sent: true
  }

BIN command:

hooks <apiKey>,<apiKey>,<apiKey>,... <title> <message>
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free