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

@neuroflow/sdk

v0.1.0

Published

NeuroFlow TypeScript SDK — Build brain-computer interfaces with real-time EEG processing

Readme

NeuroFlow SDK for TypeScript

Version TypeScript License

Build brain-computer interfaces in TypeScript. Connect to 20+ EEG/BCI devices, stream real-time neural data, and process signals directly in the browser with WASM.

import { NeuroFlowClient } from '@neuroflow/sdk';

const client = new NeuroFlowClient({
  baseUrl: 'http://localhost:8000',
  apiKey: 'your-key',
});

// Discover and connect
const devices = await client.discoverDevices();
const device = await client.connectDevice(devices[0].id);

// Start session and stream
const session = await client.startSession({ deviceId: device.id });
const stream = client.createStream({ sessionId: session.id });

stream.on('features', (features) => {
  console.log(`Focus: ${features.focusScore}`);
  console.log(`Alpha: ${features.bandPowers.alpha}`);
});

await stream.connect();

Installation

npm install @neuroflow/sdk

For in-browser WASM processing (optional):

npm install @neuroflow/sdk neuroflow-wasm

Quick Start

REST API Client

import { NeuroFlowClient } from '@neuroflow/sdk';

const client = new NeuroFlowClient({
  baseUrl: 'http://localhost:8000',
  apiKey: 'your-key',
});

// Health check
const healthy = await client.isHealthy();

// Device management
const devices = await client.discoverDevices();
const connected = await client.connectDevice(devices[0].id);

// Session lifecycle
const session = await client.startSession({ deviceId: connected.id });
const features = await client.getFeatures(session.id);
console.log(features);
await client.stopSession(session.id);

Real-Time Streaming

import { NeuroFlowClient } from '@neuroflow/sdk';

const client = new NeuroFlowClient({ baseUrl, apiKey });
const session = await client.startSession({ deviceId });

const stream = client.createStream({
  sessionId: session.id,
  includeFeatures: true,
});

stream.on('data', (packet) => {
  console.log(`Sample ${packet.sampleIndex}:`, packet.channels);
});

stream.on('features', (features) => {
  console.log(`Focus: ${features.focusScore}`);
  console.log(`Alpha power: ${features.bandPowers.alpha}`);
});

stream.on('error', (err) => console.error(err));

await stream.connect();

WASM Processing (Browser-Side DSP)

Process EEG data directly in the browser using the Rust DSP engine compiled to WebAssembly:

import { NeuroFlowDSP, extractBandPowers } from '@neuroflow/sdk';

// Create pipeline: 4 channels, 256 Hz
const dsp = await NeuroFlowDSP.create(4, 256, {
  bandpass: [1, 45, 4],    // 1-45 Hz, order 4
  notch: [50, 30],         // 50 Hz powerline removal
});

// Process raw EEG chunk (flat Float64Array, row-major)
const rawData = new Float64Array(4 * 256); // 4 channels x 256 samples
const features = dsp.process(rawData);

// Extract structured band powers
const bands = extractBandPowers(features);
console.log(`Alpha: ${bands.alpha}, Beta: ${bands.beta}`);

// Cleanup
dsp.dispose();

React Hooks

import { NeuroFlowProvider, useSession, useFocusMetrics, useWasmPipeline } from '@neuroflow/sdk';

function App() {
  return (
    <NeuroFlowProvider config={{ baseUrl: 'http://localhost:8000', apiKey: 'key' }}>
      <Dashboard />
    </NeuroFlowProvider>
  );
}

function Dashboard() {
  const { session, start, stop, features } = useSession({
    client, deviceId: 'device-1',
  });

  const { focus, relaxation, averageFocus } = useFocusMetrics({
    client, sessionId: session?.id,
  });

  return (
    <div>
      <p>Focus: {(focus * 100).toFixed(0)}%</p>
      <p>Relaxation: {(relaxation * 100).toFixed(0)}%</p>
      <button onClick={start}>Start</button>
      <button onClick={stop}>Stop</button>
    </div>
  );
}

Features

  • 20+ Device Support - Muse, OpenBCI, Emotiv, BrainBit, and more
  • Real-Time Streaming - WebSocket with automatic reconnection and exponential backoff
  • WASM DSP - Rust signal processing at 0.18ms P95 in the browser
  • React Hooks - useSession, useFocusMetrics, useDeviceConnection, useWasmPipeline
  • Context Provider - NeuroFlowProvider for shared client state
  • Type-Safe - Full TypeScript with strict mode
  • Tree-Shakeable - ESM + CJS dual output

Documentation

License

MIT