Skip to content

Wrapper for Nylas Delta Endpoint. Ties eventEmitter to the long-polling endpoint for easy streaming management

Notifications You must be signed in to change notification settings

trever/Nylas-Stream

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)

About

Wrapper for Nylas Delta Endpoint. Ties eventEmitter to the long-polling endpoint for easy streaming management

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published