Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aikar/node-beam
Fork of NPM node-beam - couldn't find a repo for this. Uses WS 0.8 for node 4. --- NOT AFFILIATED WITH IFDevelopment
https://github.com/aikar/node-beam
Last synced: about 1 month ago
JSON representation
Fork of NPM node-beam - couldn't find a repo for this. Uses WS 0.8 for node 4. --- NOT AFFILIATED WITH IFDevelopment
- Host: GitHub
- URL: https://github.com/aikar/node-beam
- Owner: aikar
- License: mit
- Created: 2015-11-10T06:39:14.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2017-01-29T03:21:03.000Z (almost 8 years ago)
- Last Synced: 2024-10-11T03:21:34.798Z (2 months ago)
- Language: JavaScript
- Homepage:
- Size: 13.7 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# node-beam
Node.JS package for Beam.pro**Note** This is an alpha version - things can, and will, change.
**IFDevelopment is not associated with Beam in any way shape or form, we just develop apps/extensions for the community**
## Example
```javascript
var connection = BeamAPI.Connect({
username: 'MyUsername',
password: 'MySecretPassword',
auth: null, // 2 Factor Authentication code as string, or null if not used
settings: {
autoJoinOwnChannel: true
}
});connection.on('channel:join', function (channel, reconnect) {
console.log(reconnect ? 'Rejoined' : 'Joined', channel.token);
});connection.on('user:join', function (channel, user, initial) {
console.log(user.username, 'joined', channel.token, initial ? '(Upon joined the channel)' : '(After joining the channel)');
});connection.on('user:leave', function (channel, user) {
console.log(user.username, 'left', channel.token);
});connection.on('chat:message', function (channel, user, message) {
console.log('[' + channel.token + '] ' + user.username + ' - ' + message);
});connection.getChannel('TATDK', function (channelData) {
if (channelData != null) {
connection.joinChannel(channelData);
} else {
console.log('Couldn\'t find channel');
}
});
```## License
This package is licensed under the [MIT License](http://git.ifdevelopment.net/IFDevelopment/node-beam/blob/master/LICENSE.md).