Wednesday, May 18, 2011

Node.js on your (jailbroken) iPhone

Wynn sat down with Nick Quaranto at Red Dirt Ruby Conference to talk about Gemcutter, RubyGems.org, and how to get started creating your own Ruby gem.

Nathan “Too Tall” Rajlich has gotten Node.js to run his jailbroken iPhone 4. If you’ve got SSH access on a jailbroken phone, simply extract the .deb package:

dpkg -i node-v0.4.5-ios-arm-1.deb

Now you can see if Node is running:

$ node> require('os').cpus()[ { model: 'N90AP', speed: 0, times: { user: 9209240, nice: 0, sys: 6997410, idle: 255377220, irq: 0 } } ]

Nate has created node-iOS to play with iOS-specific functionality with Node bindings:

var iOS = require('iOS');iOS.vibrate();// Quick vibrate, like when you receive text messageif (iOS.compass.available) { // true if the iDevice has a digitalcompass iOS.compass.on('heading', function(heading) { console.log(heading.magneticHeading); // Degrees relative tomagnetic north });}

Of course if you want to play with Node on mobile without jailbreaking your phone, Node.js powers the JavaScript services in WebOS.

[Source on GitHub] [Blog post]

No comments:

Post a Comment