Have ideas to improve npm?Join in the discussion! »

    nylas-stream

    0.0.1 • Public • Published

    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)

    Install

    npm i nylas-stream

    DownloadsWeekly Downloads

    1

    Version

    0.0.1

    License

    ISC

    Last publish

    Collaborators

    • avatar