bluetooth-hci-socket
Version:
Bluetooth HCI socket binding for Node.js
12 lines (9 loc) • 333 B
JavaScript
var os = require('os');
var platform = os.platform();
if (process.env.BLUETOOTH_HCI_SOCKET_FORCE_USB || platform === 'win32') {
module.exports = require('./lib/usb.js');
} else if (platform === 'linux' || platform === 'android') {
module.exports = require('./lib/native');
} else {
throw new Error('Unsupported platform');
}