JavaScript Sensor Abstraction js-sensor

JavaScript Sensor Abstraction js-sensor

Introduction

JavaScript offers a variety of APIs for accessing device sensor data. Obtaining this data is often done in similar but slightly different ways. Sometimes, an easy way to get all the desired sensor data at once with little interest in the underlying mechanism is desired. This library offers just this by abstracting JavaScript sensor events into a simple API.

Setup

1. Download bundle.js from ./dist folder or build 2. npm install js-sensor 3. const JsSensor = require('js-sensor'); 4. Done

Usage

const JsSensor = require('js-sensor'); JsSensor.watch JsSensor.get JsSensor.stop

Examples

Sensor examples page

Build

npm run build-all

Test

npm run test