Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

spacebro-client

Package Overview
Dependencies
Maintainers
1
Versions
47
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

spacebro-client

Allow to automagically 🌟 connect to a Spacebro server

  • 0.0.11
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
increased by33.33%
Maintainers
1
Weekly downloads
 
Created
Source

Spacebro client

Allow to automagically 🌟 connect to a Spacebro server

js-standard-style node node node node

Install

npm install --save spacebro-client

API

spacebroClient = require('spacebro-client')
// This means you will use mdns
spacebroClient.registerToMaster(actionList, clientName, zeroconfName)
// This means you know where to connect
spacebroClient.socketioConnect(server, port, actionList, clientName, zeroconfName)
spacebroClient.emit('event', data)

The actionList parameter is a list of events associated with action (functions) :

var actionList = [
  {
    name: 'shoot',
    trigger: function (data) {
      console.log('someone shoot: ', data)
    }
  },
  {
    name: 'stop',
    trigger: function (data) {
      console.log('someone stop: ', data)
    }
  }
]

Do not forget to add the event you want to broadcast to the actionList.

The clientName parameter is the name of you client. You will see it in the Spacebro log.

The zeroconfName is the name of the Spacebro service you want to connect.

Enjoy !

Please follow standard style conventions.

Contribute

You can modify the source in src/index.js. Run npm run build to transpile and test.

Keywords

FAQs

Package last updated on 08 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc