3.0.0 • Published 9 years ago

bluetooth v3.0.0

Weekly downloads
12
License
MIT
Repository
github
Last release
9 years ago

bluetooth Build Status

Get or set Bluetooth state.

Currently OS X systems only

Install

$ npm install --save bluetooth

Usage

const bluetooth = require('bluetooth');

bluetooth.isOn().then(state => {
	console.log(state);
	//=> false
});

bluetooth.on().then(state => {
	console.log('Bluetooth state changed to on');
});

bluetooth.off().then(state => {
	console.log('Bluetooth state changed to off');
});

bluetooth.toggle().then(state => {
	console.log('Bluetooth state changed to on');
});

CLI

$ npm install --global bluetooth
$ bluetooth --help

  Example
    $ bluetooth
    $ bluetooth on
    $ bluetooth off

API

.isOn()

Check if bluetooth is on or off. Returns a promise for a boolean.

.on()

Turn bluetooth on. Returns a promise.

.off()

Turn bluetooth off. Returns a promise.

.toggle(force)

Toggle the bluetooth state. Returns a promise.

force

Type: boolean

Force a state when toggling.

License

MIT © Andreas Gillström

3.0.0

9 years ago

2.0.3

9 years ago

2.0.2

9 years ago

2.0.1

9 years ago

2.0.0

9 years ago

1.0.0

9 years ago

0.0.0

9 years ago