0.0.1 • Published 9 years ago

nylas-stream v0.0.1

Weekly downloads
2
License
ISC
Repository
github
Last release
9 years ago

Nylas-Stream

A simple wrapper around the Nylas Delta API. Uses Node’s EventEmitter API to expose the different messages the delta endpoint spits out. Uses some of the concepts in Emittable and Node-Tweet-Stream behind the scenes to make the wrapper seamless without relying on Promises or Callbacks.

Installation

---------------
git clone https://github.com/trever/nylas-stream
cd nylas-stream
npm install
node test.js

--------------
npm install nylas-stream

var nylas_stream = require('nylas-stream');
var user = nylas_stream().user( < ACCESS_TOKEN > [, < NAMESPACE > ]);                                          
var sub = user.subscribe([ < CURSOR >]);
sub.events({
	'create_message':function(message){
    	console.log('Message: ', message);                              
	}
});

Usage

See above! More to come.

Methods

Nylas_Stream.user(access_token [, namespace, callback])
user.subscribe([cursor, events])
user.events(eventMap)
user.event(eventName, eventCallback)