Socket
Book a DemoInstallSign in
Socket

phone-sensor

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

phone-sensor

turn your phone into a sensor for great justice.

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

phone-sensor

for low precision passes at hardware stuff when you don't own sensors.

var senses = require('phone-sensor')
  , stringify = require('json-stringify-stream')

senses(5125)
  .on('sensor', function(sensor) {
    sensor.motion.pipe(stringify()).pipe(process.stdout)
    sensor.orientation.pipe(stringify()).pipe(process.stdout)
  })

api

senses([port], [ready]) -> Senses

listen on port, calling ready if provided.

if port is omitted it will attempt to autodetect a port.

if ready is omitted, once the sensor server is ready it'll print the url to stdout. ready takes (err, url) as arguments.

senses.close([cb])

close the sensor server.

events

Senses.on('sensor') -> Sensor

get a new Sensor object. Sensor objects have two properties: motion and orientation streams.

license

MIT

Keywords

phone

FAQs

Package last updated on 03 Jul 2013

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