Skip to content

cotaprecoarchive/horusjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Horus.js

A simple nodejs client for Horus.


#### Install with npm ``` npm install horusjs ```

Examples

var Horus = require('horusjs');
var client = new Horus('udp://0.0.0.0', 7600);

client.send({
  message: 'Hey! This is an awesome message.'
});

The example above will attempt to connect on 0.0.0.0:7600 and send the message. Very simple, and also you can:

client.send({
  tags: ['iOS'],
  message: 'ANDROID IS BETTER!'
});

And you're ready to go. Horus will delivery ANDROID IS BETTER! to everyone tagged with iOS.


You can delivery to multiple tags, just pushing them into the array
client.send({
  tags: [
    'Android',
    'WindowsPhone',
    'Blackberry'
  ],
  message: 'Bitch, please, we have React Native.'
});

And also you can build a tag with multiple arguments, using an array or a simple string
client.send({
  tags: [
    ['a', 'b', 'c'],
    'one two three'
  ],
  message: 'Full match!'
});

The example above will delivery the message to everyone with the tags a b c and one two tree. Here, "a b c" and "one two three" are considered as 2 tags.


Currently supported transport strategies

For now we only support UDP as the default protocol.