es

event-swarm

Cross-machine events made simple.

Showing:

Popularity

Downloads/wk

6

Maintenance

No Maintenance Data Available

Package

Dependencies

3

Size (min+gzip)

6.9KB

License

MIT

Type Definitions

Tree-Shakeable

No?

Categories

Readme

event-swarm

Cross-machine events made simple.

Build Status Code Coverage Dependencies DevDependencies npm Monthly Downloads Total Downloads

Easily send events across machines on the same network, built using airswarm for network discovery and simple TCP sockets.

Example:

import EventSwarm from 'event-swarm';

// On first machine...
let swarm = new EventSwarm({ channel: 'chat' });

swarm.on('ping', e => {
  // e.sender is the id of the sender.
  // e.data is the payload of the message (automatically (de)serialized).
  // e.event is the event name.
  // e.created is the millisecond timestamp of when the source created it.

  console.log('pong', e.data);
});


// On second machine...
let swarm = new EventSwarm({ channel: 'chat' });

swarm.emit('ping', {
  string: 'Hello!',
  num: 10,
  date: new Date()
});

Features:

  • Built on airswarm.
  • Channels allow for multiple swarms to exist on the same network.
  • Built-in events for connection and disconnection.
  • Broadcast events or send events to specific peers.

Contribute

  1. Fork it
  2. npm i
  3. gulp watch
  4. Make changes and write tests.
  5. Send pull request! 😎

License:

MIT

Rate & Review

Great Documentation0
Easy to Use0
Performant0
Highly Customizable0
Bleeding Edge0
Responsive Maintainers0
Poor Documentation0
Hard to Use0
Slow0
Buggy0
Abandoned0
Unwelcoming Community0
100