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

awtrix-ts

v1.4.6

Published

TypeScript API for Awtrix LED Matrix Display

Downloads

1,633

Readme

awtrix-ts npm version

TS wrapper for Awtrix API.

Awtrix API

The Awtrix class provides a TypeScript interface for interacting with the Awtrix device API. It supports device control, settings management, notifications, app switching, indicators, moodlight, and more.

Installation

npm i --save awtrix-ts

Usage

import { Awtrix } from 'awtrix-ts';

const awtrix = new Awtrix(new URL('http://your-awtrix-device-ip'));

await awtrix.power(true); // Turn device on
await awtrix.notify({ text: 'Hello World!' }); // Send a notification

Methods

power(power: boolean)

Turn the device on or off.

await awtrix.power(true); // Turn on
await awtrix.power(false); // Turn off

reboot()

Reboot the device.

await awtrix.reboot();

sleep(time: number)

Put the device to sleep for a specified time (in seconds).

await awtrix.sleep(5); // Sleep for 5 seconds

settings(settings: Settings)

Update device settings.

await awtrix.settings({
  automaticAppSwitching: false,
  globalTextColor: [0, 255, 0],
  // ...other settings
});

resetDefaultSettings()

Resets the device settings back to default.

await awtrix.resetDefaultSettings();

erase()

Factory resets the device. Does not modify WiFi settings.

await awtrix.erase();

screen()

Get the current screen content.

const screen = await awtrix.screen();

stats()

Retrieve device statistics.

console.log(await awtrix.stats());

effects()

List available effects.

const effects = await awtrix.effects();

transitions()

List available transitions.

const transitions = await awtrix.transitions();

loop()

Get the app loop configuration.

console.log(await awtrix.loop());

playMelody(rtttl: string)

Play a melody using RTTTL format.

await awtrix.playMelody('d=4,o=5,b=140:c6,e6,g6');

playMelodyFile(name: string)

Play a melody file by name.

await awtrix.playMelodyFile('melody.mp3');

setIndicator(indicator: IndicatorPayload)

Set an indicator LED.

await awtrix.setIndicator({
  color: [255, 0, 0],
  position: awtrix.Indicators.UpperRight,
  // blink: 500,
  // fade: 1000,
});

clearIndicator(indicator: Indicators)

Clear an indicator LED.

await awtrix.clearIndicator(awtrix.Indicators.UpperRight);

moodlight(setting: MoodlightColor | MoodlightKelvin)

Set moodlight color or temperature.

await awtrix.moodlight({ brightness: 170, kelvin: 2300 });
await awtrix.moodlight({ brightness: 170, color: '#FF00FF' });

clearMoodlight()

Turn off moodlight.

await awtrix.clearMoodlight();

notify(notification: Interaction)

Send a notification.

await awtrix.notify({
  text: 'Hello World!',
  icon: '3049',
  pushIcon: awtrix.PushIcon.MoveOnce,
  effect: awtrix.Effects.PlasmaCloud,
  repeat: 5,
});

dismissNotification()

Dismiss the current notification.

await awtrix.dismissNotification();

app(name: string, app: Interaction)

Send a custom app payload.

await awtrix.app('demoApp', {
  text: 'This is a custom app!',
  icon: '1000',
  repeat: 5,
  duration: 3000,
  effect: awtrix.Effects.TwinklingStars,
  scrollSpeed: 150,
});

launchApp(name: string)

Launch an app by name.

await awtrix.launchApp('demoApp');

nextApp(), previousApp()

Switch between apps.

await awtrix.nextApp();
await setTimeout(2000);
await awtrix.previousApp();

deleteApp(name: string)

Delete a custom app.

await clock.deleteApp('myApp');

Progress Bar Example

Display a progress bar using a custom app:

for (let i = 0; i <= 100; i++) {
  if (i % 5 === 0) {
    await awtrix.app('Progress', {
      text: `${i}%`,
      progress: i,
      duration: 1,
    });
    if (i === 0) {
      await awtrix.launchApp('Progress');
    }
    if (i === 100) {
      await awtrix.app('Progress', {
        text: 'Done!',
        color: [0, 255, 0],
      });
    }
    await setTimeout(500);
  }
}

Draw Pixels

Draw shapes on the display:

await clock.notify({
  draw: [
    new clock.draw.Pixel(0, 0, [255, 0, 0]),
    new clock.draw.Line(0, 1, 15, 1, [0, 255, 0]),
    new clock.draw.Rectangle(2, 2, 12, 6, [0, 0, 255]),
    new clock.draw.FilledRectangle(3, 3, 10, 4, [255, 255, 0]),
    new clock.draw.Circle(8, 1, 3, [0, 255, 255]),
    new clock.draw.FilledCircle(8, 3, 2, [255, 0, 255]),
    new clock.draw.Text(0, 1, 'AWTRIX', [255, 255, 255]),
  ],
});

Other

  • All API calls are asynchronous and return Promises.
  • The class exposes enums for transitions, indicators, and effects for convenience.