Skip to content
/ bluezjs Public

Bluezjs is a NodeJS library for using Bluetooth Low Energy on Linux systems via BlueZ

License

Notifications You must be signed in to change notification settings

limal/bluezjs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

bluezjs logo

Bluezjs is a NodeJS library for using Bluetooth Low Energy on Linux systems via BlueZ. At this time it only supports the central mode.

Installation

npm i bluezjs

or

yarn add bluezjs

Example usage

Running an ExpressJS server that initiates a scan for nearby Bluetooth LE devices.

const bluezjs = require("bluezjs");
const express = require("express");

const app = new express();
const http = require("http").Server(app);

app.get("/scan", (req, res) => {
  bluezjs.startDiscovery();
  res.json({ status: "ok" });
});

app.get("/stopScanning", (req, res) => {
  bluezjs.stopDiscovery();
  res.json({ status: "ok" });
});

bluezjs.init().then(() => {
  http.listen(3000);
});

What makes it different?

Bluezjs is using the newest D-Bus library dbus-next which makes it simple to build and use on the newer versions of NodeJS.

bluezjs vs noble

The most popular BLE (central mode) library for NodeJS is noble. It's great but it has its limiations. Below is a table that shows differences between bluezjs and noble.

Feature noble bluezjs
NodeJS 10 and later No Yes
D-Bus (more stable) No Yes
Raspberry Pi Yes Yes
Peripheral mode No No
MacOS Yes No
Windows Yes No

About

Bluezjs is a NodeJS library for using Bluetooth Low Energy on Linux systems via BlueZ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published