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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@twinklyjs/twinkly

v0.0.6

Published

A Twinkly API client

Downloads

35

Readme

twinklyjs

This is an unofficial TypeScript implementation for Twinkly Lights. Everything here is based on the excellent work at https://xled-docs.readthedocs.io/en/latest/.

CLI usage

With Node.js installed, you can globally install @twinklyjs/twinkly and use it as a command line tool:

npm install -g @twinklyjs/twinkly

To discover twinkly devices running on your network, try out:

twinkly discover

Set the IP of your device once so all future commands use that IP:

twinkly config setip <IP>

Use twinkly --help to learn more:

Usage: twinkly [options] [command]

CLI tool for managing Twinkly smart lights

Options:
  -V, --version                                   output the version number
  -h, --help                                      display help for command

Commands:
  discover [options]                              Discover Twinkly devices on the network.
  config <action> [value]                         Manage configuration settings
  get-movie [options]                             Get the current movie
  get-movies [options]                            Get movies installed.
  set-movie [options] <id>                        Set LED color in RGB
  set-color [options] <red> <green> <blue>        Set LED color in RGB
  set-op-mode [options] <mode>                    Set the LED operation mode
  set-brightness [options] <mode> <type> <value>  Send http request for changing brightness.
  get-brightness [options]                        Get the brightness of the device.
  get-op-mode [options]                           Get the current LED operation mode of the device.
  get-color [options]                             Get the color of the device.
  get-details [options]                           Get the details of the device.
  get-device-name [options]                       Get the name of the device.
  set-device-name [options] <name>                Set the name of the device.
  get-timer [options]                             Get the timer set for the device.
  set-timer [options] <TimeOn> <TimeOff>          Send http request for setting timer.
  help [command]                                  display help for command

API Usage

twinklyjs is also available as a library. Most operations are available on the api object, which supports basic HTTP calls. Authentication is automatically handled.

import {TwinklyClient} from '@twinklyjs/twinkly';

const client = new TwinklyClient({ip: '10.0.0.187'});
const details = await client.getDeviceDetails();
console.log(details);

await client.setLEDOperationMode({mode: 'color'});
await client.setLEDColor({r: 0, g: 255, b: 0});
const data = await client.getLEDOperationMode();
console.log(data);

Discovery

Twinkly supports device discovery via UDP broadcasting. This is available in a slightly easier to use form:

import {discover} from '@twinklyjs/twinkly';

const devices = await discover();
console.log(devices);

Browser usage

This module is usable from the browser, with the exception of the following APIs which require UDP:

  • Discovery
  • Realtime

The HTTP server in twinkly devices do not provide CORS headers, so you will need to proxy requests through a backend.

Examples

There are a few examples of API usage available in /examples.

| Example | Description | |--|---| | realtime | Use the realtime UPD API to send light frames | |-|-|

Contributing

This module currently only implements a subset of the available API. We love contributions! Feel free to open a PR, and reference the underlying part of the API you're trying to support. See CONTRIBUTING to learn more.

Want to join in on the discussion? visit our discord: https://discord.gg/AtA98tr2ab

License

MIT