New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

bearychat

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

bearychat - npm Package Compare versions

Comparing version

to
0.1.0

__test__/rtm.message-test.js

8

dist/rtm.js

@@ -11,2 +11,6 @@ 'use strict';

var _rtm3 = require('./rtm.message');
var _rtm4 = _interopRequireDefault(_rtm3);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -47,4 +51,6 @@

Client: _rtm2.default
Client: _rtm2.default,
message: _rtm4.default
};
module.exports = exports['default'];

7

package.json
{
"name": "bearychat",
"version": "0.0.3",
"version": "0.1.0",
"description": "BearyChat API client for Node and the Browser.",

@@ -10,2 +10,3 @@ "main": "dist/index.js",

"build": "babel src -d dist",
"build-doc": "markdown-toc -i README.md && markdown-toc -i README_CN.md",
"prepublish": "npm run build"

@@ -38,4 +39,6 @@ },

"jest": {
"testRegex": "(/__tests__/.*|\\-(test|spec))\\.js$"
"testRegex": "(/__tests__/.*|\\-(test|spec))\\.js$",
"collectCoverage": true,
"coverageReporters": ["text"]
}
}

@@ -8,5 +8,6 @@ # bearychat.js

[BearyChat]: https://bearychat.com
[中文文档](./README_CN.md)
<!-- toc -->

@@ -24,2 +25,4 @@

* [`rtm.channelInfo`](#rtmchannelinfo)
* [`rtm.message`](#rtmmessage)
* [`rtm.loop`](#rtmloop)
- [Test](#test)

@@ -152,2 +155,21 @@ - [Contributing](#contributing)

### `rtm.message`
Provides handful helpers for rtm message parsing.
### `rtm.loop`
To achive more flexible usage, `bearychat.js` won't provide any implementations
for `rtm.loop`. You can use [`examples/rtm_loop`](./exapmles/rtm_loop) as
implementation reference.
Basically, `rtm.loop` contains 3 stages:
1. `rtm.start`: Use rtm token to authenticate user and open a websocket
connection.
2. `ping`: Keep sending `type=ping` message to server after connected. Pinging
interval with `5000ms` is suggested.
3. `loop`: Subscribe to websocket's message event and consume the message comes
from the server. You can use `rtm.message` for message parsing.
## Test

@@ -154,0 +176,0 @@

import Client from './rtm.client';
import message from './rtm.message';

@@ -37,2 +38,4 @@ function currentTeamInfo(token) {

Client,
message,
};