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 🙏

© 2024 – Pkg Stats / Ryan Hefner

busylight

v0.6.0

Published

node library for busylight

Downloads

29

Readme

🚨 Busylight for node

A node library for the Busylight usb device. More info on the Busylight can be found here: http://busylight.com/

Install

npm install busylight

*extra steps for node-webkit

Quick start

Get a Busylight

var busylight = require('busylight').get()

Make it dance

busylight.ring().pulse();

STOP!

busylight.off();

Hammertime...

busylight.ring('Funky').blink(['red', 'yellow', 'blue', 'green'], 150);

Usage

Finding an attached busylight

Get the first available busylight

var busylight = require('busylight').get()

Get a specific Busylight attached to the system.

var busylight = require('busylight').get(path);

The path can be found by looking at the connected Busylights. Pass true if you want to see all connected USB HIDs. This can be useful if the Busylight is not detected.

var busylights = require('busylight').devices(showAllUSBDevices);

Defaults method

Set up different defaults that the busyligt will use if you don't give specific instructions

busylight.defaults({
  keepalive: true,      // If the busylight is not kept alive it will turn off after 30 seconds
  color: 'white',       // The default color to use for light, blink and pulse
  duration: 30 * 1000,  // The duration for a blink or pulse sequence
  rate: 300,            // The rate at which to blink or pulse
  degamma: true,        // Fix rgb colors to present a better light
  tone: 'OpenOffice',   // Default ring tone
  volume: 4             // Default volume
});

light(color)

To make the busylight light a specific color just use a valid css color.

busylight.light('orange')

To turn it off

busylight.light(false);

ring(tone, volume)

Make the busylight play a ringtone

busylight.ring('OpenOffice')

Volumesteps The busylight accepts volume values of 0-7

Ringtones

  • OpenOffice
  • Quiet
  • Funky
  • FairyTale
  • KuandoTrain
  • TelephoneNordic
  • TelephoneOriginal
  • TelephonePickMeUp
  • Buzz (Basically annoying white noise)

blink(colors, rate)

Fades smoothly between colors. If only a single color is defined it will pulse between that color and no light

busylight.blink(['red', 'green', 'blue'], 500);

pulse(colors, rate)

The pulse method fades smoothly between the defined colors. If only a single color is defined it will pulse between that color and no light

busylight.pulse(['#f00', '#0f0', '#00f']);

off()

Turns everything off.

busylight.off();

close()

When you are done using the busylight you can use the close method to shut down the connection correctly

busylight.close();

Chaining

Simple chaining is available to let you eg. ring and blink in one go

busylight.ring().blink();

Turn it off again

busylight.ring(false).blink(false);

Supports

Currently only the Kuando Busylight has been tested, but it seems the busylight unit is available under different names

  • Kuando Busylight

TypeScript

Busylight supports TypeScript with own Type Definition files. Enjoy! :)

Electron and Electron.NET

Busylight relies on node-hid. node-hid needs to be built for each different Electron Node.js integration a own build. Use for that electron-rebuild

Node-webkit

Busylight relies on node-hid. node-hid needs to be built for each platform and specific version of node-webkit, so to make it work you need to build node-hid using nw-gyp https://github.com/rogerwang/node-webkit/wiki/Build-native-modules-with-nw-gyp