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

humidi

v2.0.0

Published

Simple and lightweight MIDI library for humans. Zero dependencies, less than 5kB gzipped.

Readme

humidi

Simple and lightweight MIDI library for humans. Zero dependencies, less than 5kB gzipped.

Provides a simple event-driven interface for working with MIDI input devices, including automatic device management, note tracking for stuck note prevention, and per-device enable/disable functionality.

🎹 Live Demo

Try HuMIDI with your MIDI keyboard: https://d-buckner.github.io/humidi/

📖 Documentation

Full API documentation is available at: https://d-buckner.github.io/humidi/docs/

Installation

npm install humidi

Basic Usage

import HuMIDI, {
  type NoteOnEvent,
  type NoteOffEvent,
  type PitchBendEvent,
} from 'humidi';

// Request MIDI access
await HuMIDI.requestAccess();

// Listen for note events
HuMIDI.on('noteon', (event: NoteOnEvent) => {
  console.log(`Note ${event.note} pressed with velocity ${event.velocity}`);
});

HuMIDI.on('noteoff', (event: NoteOffEvent) => {
  console.log(`Note ${event.note} released`);
});

// Listen for note presses only on channel 1
HuMIDI.on('noteon', console.log, 0);

// Unsubscribe to all listeners on channel 1
HuMIDI.unsubscribeToChannel(0);

// Listen for pitch bends
HuMIDI.on('pitchbend', (event: PitchBendEvent) => {
  console.log(`${(event.value * 100)}% pitch bend`);
});

Device Management

// Check permissions without requesting access
const hasPermissions = await HuMIDI.hasPermissions();

// Get all available input devices
const inputs = HuMIDI.getInputs();

// Disable a specific device
const piano = inputs.find(input => input.name.includes('Piano'));
piano?.disable();

// Listen for device connections
HuMIDI.on('inputconnected', (event) => {
  console.log(`Device connected: ${event.input.name}`);
});

HuMIDI.on('inputdisconnected', (event) => {
  console.log(`Device disconnected: ${event.input.name}`);
});

API Reference

Core Methods

  • HuMIDI.requestAccess() - Request MIDI access from browser
  • HuMIDI.hasPermissions() - Check if MIDI permissions are granted
  • HuMIDI.getAccessStatus() - Get current access status
  • HuMIDI.getInputs() - Get all available MIDI input devices
  • HuMIDI.setEnabled(enabled) - Enable/disable all MIDI processing
  • HuMIDI.isEnabled() - Check if MIDI processing is enabled

Event System

  • HuMIDI.on(event, handler, channel?) - Register event handler
  • HuMIDI.off(event, handler, channel?) - Remove event handler
  • HuMIDI.unsubscribeToChannel(channel) - Remove all handlers for channel

Events

  • 'noteon' - MIDI note pressed (NoteOnEvent)
  • 'noteoff' - MIDI note released (NoteOffEvent)
  • 'pitchbend' - Pitch bend wheel moved (PitchBendEvent)
  • 'sustainon'/'sustainoff' - Sustain pedal (SustainEvent)
  • 'inputconnected'/'inputdisconnected' - Device connections (InputEvent)

Device Objects

Each MIDIInput device has:

  • Properties: id, name, manufacturer, state
  • Methods: enable(), disable(), isEnabled()

Features

  • Per-device note tracking - Prevents stuck notes when devices disconnect
  • Channel support - Listen to specific channels or all channels
  • Hot-plug support - Automatic handling of device connections
  • Zero dependencies - Lightweight and self-contained
  • TypeScript support - Full type definitions included

Links

License

MIT License - see LICENSE file for details.