Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including openni-browser with all npm packages installed. Try it out:

var openniBrowser = require("openni-browser")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

openni-browser v0.1.7


Server <-> Browser bridge for OpenNI skeleton.

Works with kinect.

Uses Socks.js (via Shoe).


Install libusb and OpenNI following the platform-specific instructions at

$ npm install openni-browser

Create Node Server

var kinectSock = require('openni-browser')();
var ecstatic = require('ecstatic')(__dirname + '/public');

var server = require('http').createServer(ecstatic);

kinectSock.install(server, '/skeleton');

server.listen(8080, function() {
  console.log('kinect socks server listening...');

Create Client

Copy browser/openni.js into the public folder.

In your HTML file include that script before the body close tag:

<script src="openni.js"></script>

Inside a browser script:

Initialize connection to the server by providing a full or relative URL:

var skeleton = openni('/skeleton');

Listen for user events:

].forEach(function(userEventType) {
  sleleton.on(userEventType, function(userId) {
    console.log(userEventType + ' (' + userId + ')');

Listen for joint position changes:

jointNames = [

jointNames.forEach(function(jointName) {
  kinect.on(jointName, function(userId, x, y, z) {
    console.log('The joint ' + jointName + ' of user ' + userId +
      ' moved to (' + x + ', ' + y + ', ' + z + ')');

Connection Handling

The skeleton object will also emit:

  • connect — when there is a connection to the server
  • end — when the connection to the server is ended


See the examples folder.



RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free