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 geolocation-stream with all npm packages installed. Try it out:

var geolocationStream = require("geolocation-stream")

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

geolocation-stream v0.0.1

streaming API on top of the html5 geolocation API

geolocation-stream

npm install geolocation-stream

use HTML5 Geolocation to watch location changes the node way -- with streams

var movement = geolocationstream()

movement is a readable stream and speaks stream events: data, error and end. that means you can pipe movement output to anything that accepts streams, such as an XHR. in this case the data events will be lat/lon position updates using the watchPosition part of HTML5 geolocation

to generate demo-bundle.js using browserify:

npm install browserify -g
browserify demo.js -o demo-bundle.js

MIT LICENSE

Metadata

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