Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

user-stream

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

user-stream

Simple twitter user stream client. Only one dependency (oauth).

  • 0.0.8
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

user-stream

NPM module

Simple Node.js Twitter (API 1.1) user stream client (https://dev.twitter.com/docs/streaming-apis/streams/user)

NPM

Install

npm install user-stream

Usage

var Stream = require('user-stream');
var stream = new Stream({
    consumer_key: '',
    consumer_secret: '',
    access_token_key: '',
    access_token_secret: ''
});

//create stream
stream.stream();

//listen stream data
stream.on('data', function(json) {
  console.log(json);
});

Events

  • data - stream data in JSON format
  • garbage - stream data who can't be parsed to JSON
  • close - stream close event (stream connection closed)
  • error - error event (request error, response error, response status code greater than 200)
  • connected - stream created
  • heartbeat - twitter emitted heartbeat

Methods

  • stream - create stream connection
  • destroy - destroy/close stream connection
var params = {
    with: 'user'
}
//create stream
stream.stream(params);
Reserved parameters for lib
  • delimited
  • stall_warnings

Keywords

FAQs

Package last updated on 17 Dec 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc