node package manager

Introducing npm Enterprise add-ons. Integrate third-party dev tools into npm…


Get or set Bluetooth state.


Get or set Bluetooth state.

Currently OS X systems only

$ npm install --save bluetooth
const bluetooth = require('bluetooth');
bluetooth.isOn().then(state => {
    //=> false 
bluetooth.on().then(state => {
    console.log('Bluetooth state changed to on');
}); => {
    console.log('Bluetooth state changed to off');
bluetooth.toggle().then(state => {
    console.log('Bluetooth state changed to on');
$ npm install --global bluetooth
$ bluetooth --help
    $ bluetooth
    $ bluetooth on
    $ bluetooth off

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

Turn bluetooth on. Returns a promise.

Turn bluetooth off. Returns a promise.

Toggle the bluetooth state. Returns a promise.

Type: boolean

Force a state when toggling.

MIT © Andreas Gillström