npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@neurosdk2/websdk

v1.0.1

Published

To use this library, you will need:

Readme

NeuroSDK: Web

Getting started

Prerequisites

To use this library, you will need:

  • a compatible device, turned on and either in pairing mode or already paired to your computer
    • Headband
    • BrainBit
    • BrainBit Flex
  • a browser with WebBluetooth capabilities
    • any modern Chromium-based browser, e.g. Google Chrome
    • to use WebBluetooth on Linux desktops you might need to turn on experimental Chromium flags
  • a Bluetooth connection (adapter)
  • a secure context
    • localhost
    • HTTPS-enabled webpage

Concepts

Device

The physical device that you have. Different devices come with different hardware and therefore can have different capabilities.

Sensor object

The JS object that you can use to interact with the device. It is obtained after making a successful connection to a device. You send commands to the device by calling methods on that object, and you receive data from the device by setting up callbacks on the sensor object.

Sample

A single set of values from the physical sensors (electrodes, gyroscope, infrared detectors), combining values from multiple channels.

Channel

A channel represents a single physical sensor.

Measurement

The period where your device sends data to the host. For example, you can start a signal measurement with startSignal() and end it with stopSignal(). During the time between those calls, a signalCallback will be called each time a new sample is available.

Filter

A post-processing function that can be applied to the samples. This package includes a 4Hz high pass, 30Hz low pass and two band stop filters. Filters can be combined sequentially to form a chain that acts as a single filter.

Example code

Starting a measurement and logging some signal samples:

import { requestSensor } from "@neurosdk2/websdk";

/* Helper function to pause the script */
function sleep(timeout): Promise<void> { return new Promise((resolve) => setTimeout(resolve, timeout)); }

/* `requestSensor` will return once the user has either dismissed the permission prompt (in which case, an error will be thrown) or selected a compatible device, as specified by the filter, and a connection has been established successfully */
const sensor = await requestSensor(["Headband", "BrainBit2"])
/* Callbacks are called once data is available. You can access battery level as a property at any time at `sensor.batteryLevel`. */
sensor.batteryLevelCallback = (level) => { console.log('Battery level', level); }
sensor.signalCallback = (signal) => { console.log('Samples', signal); }
/* This function starts the measurement. */
await sensor.startSignal()
/* For 5 seconds, signal samples will be logged about 250 times per second */
await sleep(5)
await sensor.stopSignal()

Supported devices

Listed below are flat interfaces for supported devices. Most of the properties are the same for all of them and are inherited from the Sensor<T> type.

BrainBit2

BrainBitFlex

Headband

Sample types

export type XYZ = [number, number, number];

Other types

Enums