ws-json-client-stream

2.0.2 • Public • Published

ws-json-client-stream

A wrapper around the ws npm module that adds JSON-parsing stream interface.

Example usage

Below is an example that subscribes to all the transactions happening on the Stellar network. Stellar API endpoint documentation

var _ = require( 'highland' ),
    socket = require( 'ws-json-client-stream' ),
    stellarSocket = socket( 'ws://live.stellar.org:9001' );

_(stellarSocket).each(console.log);

stellarSocket.write({
  "command" : "subscribe",
  "streams" :  [ "transactions" ]
});

Dependencies (4)

Dev Dependencies (5)

Package Sidebar

Install

npm i ws-json-client-stream

Weekly Downloads

1

Version

2.0.2

License

MIT

Last publish

Collaborators

  • mpj