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

nodehelium

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

nodehelium

Node.js Helium API wrapper

0.2.0
npm
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

nodehelium

This is a Node.js library that wraps libhelium.

Example

var helium = require('nodehelium');

// create a helium connection
obj = new helium.Helium();

// open it
obj.open();

var token = "PbOkU4Jo+NObbPe27MJGNQ==";
var mac = "000000fffff00002";

var i = 0;
// set up the message callback
obj.on( 'message', function(data) {
	console.log("Message ");
	console.log(data);
	if (i >= 5) {
		console.log("unsubscribing from", mac)
			obj.unsubscribe(mac);
		setTimeout(function() {
			console.log("closing helium connection");
			obj.close();}, 5000);
	}
	i++;
});

// subscribe to a device
obj.subscribe(mac, token);

// send the device a message
obj.send(mac, token, "hello from node.js");

FAQs

Package last updated on 13 Jan 2015

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