Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/busyorg/busyjs
Busy.js
https://github.com/busyorg/busyjs
busy busyjs ws
Last synced: 7 days ago
JSON representation
Busy.js
- Host: GitHub
- URL: https://github.com/busyorg/busyjs
- Owner: busyorg
- License: mit
- Created: 2018-02-08T19:52:25.000Z (almost 7 years ago)
- Default Branch: develop
- Last Pushed: 2018-07-04T16:25:09.000Z (over 6 years ago)
- Last Synced: 2024-10-07T22:37:01.401Z (about 1 month ago)
- Topics: busy, busyjs, ws
- Language: JavaScript
- Homepage:
- Size: 52.7 KB
- Stars: 1
- Watchers: 3
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: docs/CONTRIBUTING.md
- License: LICENSE
- Code of conduct: docs/CODE_OF_CONDUCT.md
Awesome Lists containing this project
README
# Busy.js
A lightweight JavaScript library for Busy
### Install
```
npm install busyjs --save
```### Usage
```js
var busy = require('busyjs');// Init WebSocket client
var client = new busy.Client('wss://gtg.steem.house:8090');// Get accounts
client.call('get_accounts', ['fabien'], function(err, result) {
console.log(err, result);
});
```### Promises
You can also use Busy.js with promises by promisifying busy with
[bluebird](https://github.com/petkaantonov/bluebird) as in:```js
var busy = require('busyjs');
bluebird.promisifyAll(busy.Client.prototype);
```It'll add a *Async* to all busy functions (e.g. return client.callAsync().then())
```js
// So instead of writing client.request('get_accounts', ['fabien'], cb); you have to write:
return client.callAsync('get_accounts', ['fabien']).then(function(result) {
console.log(result); // => [{ id: 26921, name: 'fabien' ...]
});
```## License
[MIT](LICENSE).