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.2
latest
npm
Version published
Maintainers
1
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");

Installing

OSX

Install libhelium from the OSX package

Then you should be able to npm install nodehelium.

Debian/Ubuntu/Centos/Fedora

Install libuv and libhelium from the packagecloud packages

Then npm install nodehelium should work.

Source

Build libuv and libhelium from source and install them. When building libu be sure to export CFLAGS="-fPIC" before running './configure' and 'make'. Then npm install nodehelium.

The reason libuv is needed is because libhelium uses a newer libuv than nodejs 0.10.x uses, and we have to rewrite the symbol table in libhelium and libuv so it doesn't conflict with the libuv symbols in node.js. This hack should be unnecessary after nodejs 0.12 is released.

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