my-binance-ws
v1.0.2
Published
A simple Node.js package for interfacing with Binance's WebSocket streams.
Downloads
5
Readme
my-binance-ws
A simple Node.js package for interfacing with Binance's WebSocket streams.
Installation
Features
- Connect to any Binance stream.
- Subscribe and unsubscribe from streams in real-time.
Binance WebSocket Backend
This backend service facilitates real-time data communication with the Binance API using WebSockets.
Table of Contents
Prerequisites
- Node.js v14 or newer
- npm v6 or newer
Installation
npm install my-binance-ws
Usage
- import the library.
- Use the provided
BinanceWSClient
to initiate WebSocket connections to Binance:
const BinanceWSClient = require('my-binance-ws');
const client = new BinanceWSClient();
client.connect('streamName');
Supported Functions
connect(streamName)
: Connects to a specified Binance stream.subscribe(streams)
: Subscribes to one or more streams.unsubscribe(streams)
: Unsubscribes from one or more streams.setProperty(propertyName, value)
: Sets a property. Currently supports enabling or disabling combined stream payloads.
License
MIT
Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.