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

muse-jsx

v0.2.2

Published

Reconstructed muse-js: Muse EEG Headset JavaScript Library

Downloads

31

Readme

muse-jsx

DOI npm version License GitHub Release

Current npm release: 0.2.2

muse-jsx (muse-js改 / muse-js kai) is a JavaScript library for Muse 2, Muse S (Classic), and Muse S (Athena) EEG headsets (using Web Bluetooth).

Demo Page: https://fuji3to4.github.io/muse-jsx/

About this

This repository is derived from the original muse-js and updated for compatibility with modern Node.js versions (20+) and RxJS (7+). It also includes experimental support for newer Muse S (Athena).

  • Original: https://github.com/urish/muse-js
  • License: See the included LICENSE (original attributions preserved).
  • Improvements:
    • Node.js 20+ compatibility fixes
    • RxJS 7+ support
    • 🧪 Experimental Support for Muse S (Athena)

Installation

Option 1: Install from npm

npm install muse-jsx

This package supports both CommonJS (require) and ES modules (import).

Option 2: Install from GitHub (latest development version)

npm install git+https://github.com/fuji3to4/muse-jsx.git

Option 3: Clone and link locally

git clone https://github.com/fuji3to4/muse-jsx.git
cd muse-jsx
npm install
npm link

Then in your project:

npm link muse-jsx

Requirements

  • Node.js 18+ (recommended: 20+). TextEncoder/TextDecoder are available natively; no polyfills needed.
  • Browser: Web Bluetooth capable (Chrome/Edge). A secure context (HTTPS or localhost) is required.

Running the Demo App

npm install
npm start

Then open http://localhost:4445/

Usage - Classic MuseClient

For Muse 2, Muse S (Classic) devices, use the classic MuseClient:

import { MuseClient } from 'muse-jsx';

async function main() {
  const client = new MuseClient();
  await client.connect();
  await client.start();
  
  client.eegReadings.subscribe(reading => {
    console.log(reading);
  });
  
  client.telemetryData.subscribe(telemetry => {
    console.log(telemetry);
  });
  
  client.accelerometerData.subscribe(acceleration => {
    console.log(acceleration);
  });
}

main();

Auxiliary Electrode (Classic)

The Muse 2016 EEG headsets contain four electrodes, and you can connect an additional Auxiliary electrode through the Micro USB port. By default, data from the Auxiliary electrode channel is not read. Enable it by setting the enableAux property to true before calling the connect method:

async function main() {
  const client = new MuseClient();
  client.enableAux = true;
  await client.connect();
}

In the demo app, AUX is off by default and can be enabled via the checkbox.

PPG / Optical Sensor (Classic)

The Muse 2 and Muse S contain PPG/optical blood sensors. There are three signal streams: ppg1, ppg2, and ppg3. These are ambient, infrared, and red (respectively) on the Muse 2, and (we think, unconfirmed) infrared, green, and unknown (respectively) on the Muse S.

To enable PPG before connecting:

async function main() {
  const client = new MuseClient();
  client.enablePpg = true;
  await client.connect();
}

To subscribe to PPG readings:

client.ppgReadings.subscribe((ppgreading) => {
  console.log(ppgreading);
});

Note: PPG is not present on Muse 1/1.5, and enabling it may have unexpected consequences.

Event Markers (Classic)

The MuseClient includes an eventMarkers stream for introducing timestamped event markers:

async function main() {
  const client = new MuseClient();
  client.eventMarkers.subscribe((event) => {
    console.log(event);
  });
  
  client.injectMarker("house");
  client.injectMarker("face");
  client.injectMarker("dog");
}

Usage - Muse S (Athena Model) 🧪 Experimental

For newer Muse S units using the Athena protocol, use the MuseAthenaClient:

⚠️ Important: The original Muse S works with the classic MuseClient. This "Athena" client is specifically for newer Muse S units using the Athena protocol, which is incompatible with the classic logic.

Basic Usage

import { MuseAthenaClient } from 'muse-jsx';

async function main() {
  const client = new MuseAthenaClient();
  await client.connect();
  await client.start('p1045'); // Start with a specific preset
  
  client.eegReadings.subscribe(reading => {
    console.log(reading.samples); // 8 channels, 256Hz
  });
}

main();

Supported Features (Beta)

  • Real-time EEG (8 channels, 256Hz)
  • Accelerometer & Gyroscope (IMU)
  • PPG / Optical Sensors
  • Battery Status
  • Preset Selection (e.g., p1045, p1041, p21) and Packet Logging

Additional Resources

For detailed instructions and migration tips, please refer to:

Building and Deployment

Local Build

To preview the deployable assets locally:

npm run build
npm run build:demo

Output directory: dist-demo/

GitHub Pages

This repository includes a GitHub Pages workflow (.github/workflows/pages.yml). Pushing to main builds the demo/ with Vite and deploys dist-demo/ to Pages.

Using in Node.js

This fork does not include or document Node.js support via bleat/noble. It targets Web Bluetooth in supported browsers. If you need Node.js integration, please refer to the original project and its ecosystem.

References

This project was made possible by the following open-source projects. We are grateful for their contributions and inspiration.

License

MIT License