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

phi-launchpad

v0.9.11

Published

Library for easily interacting with the Novation Launchpad.

Readme

phi-launchpad

A Node.js interface for interacting with the Novation Launchpad.

phi-launchpad implements the Launchpad MIDI spec allowing you to catch button presses and manipulate LEDs.

Installation

Install via npm:

$ npm install phi-launchpad

Usage

Setup

Connect to MIDI:

var plaunchpad = require('phi-launchpad');

var lpadIn = new plaunchpad.input();
lpadIn.init();

var lpadOut = new plaunchpad.output();
lpadOut.init();

MIDI device is configurable; see below.

Listening for button presses

lpadIn.on('press', function(row, col) {
  console.log(util.format("press %d %d", row, col));
});

lpadIn.on('release', function(row, col) {
  console.log(util.format("release %d %d", row, col));
});

Setting LEDs

lpadOut.setLed(3, 4, [0, 3]);
lpadOut.setLed(4, 2, [2, 2]);
lpadOut.setLed(0, 0, [2, 0]);
lpadOut.setLed(8, 8, [3, 3]);

Set the LED in row 3, column 4, to be the color with red = 0 la(no red) and green = 3 (full green). Calls with arguments out of range either in position or color are ignored.

plaunchpad addresses the Launchpad as a 9x9 matrix with a "hole" in the upper rightmost element.

Colors are represented as red/green pairs: [0..3,0..3]

Buffered Updates

The Launchpad is double-buffered; it has one showing buffer, and another that is hidden. To reduce flicker while updating large portions of the Launchpad, you can send updates to the hidden buffer, then swap the two buffers to show all of the changes immediately.

Send a number of updates to the hidden buffer:

lpadOut.setLed(5, 6, [2, 2], 'update');
lpadOut.setLed(3, 4, [0, 2], 'update');
lpadOut.setLed(5, 7, [2, 0], 'update');

Show all changes at once:

lpadOut.swapBuffers();

Rapid Updates

You can update large parts of the Launchpad with fewer MIDI messages using the rapid update function. Pass in a list of up to 80 red/green pairs as a flat array:

lpadOut.rapidUpdate(2, 3, 4, 2, 0 ... 3, 2);
lpadOut.swapBuffers();

Note that swapBuffers() needs to be called for the update to show.

Autoflash

Set some LEDs with the 'flash' flag:

lpadOut.setLed(2, 5, [2, 2], 'flash');

Then turn on autoflash to see them blink at a set rate:

lpadOut.autoFlash(true);

Pass false to autoFlash to stop the blinking.

lpadOut.autoFlash(false);

Adjusting Brightness

Set brightness as a single value (0 - 255):

lpadOut.setBrightness(64);

Set brightness as duty cycle (numerator, denominator):

lpadOut.setDutyCycle(1, 8);

MIDI device name

To use a Launchpad with a MIDI device name other than "Launchpad" (the default if unspecified), you can do the following:

var midiInt = require('./node_midi_interface').midi;
var m = new midiInt(/Your Device Name/);

var lpadIn = new plaunchpad.input();
lpadIn.init(m);

lpadOut = new plaunchpad.output();
lpadOut.init(m);