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

@eins78/pixelstatus

v1.1.1

Published

openpixelcontrol client for status displays

Downloads

11

Readme

pixelstatus

[WORK IN PROGRESS]

npm package Build Status

Build color-coded status screens with LED pixels, Raspberry Pi and fadecandy.
Configure section colors using expectations on a HTTP response.
Provides a daemon with task runner, REST API and Web UI.

Demo

OpenGL Simulator:

git clone https://github.com/eins78/pixelstatus
cd pixelstatus
npm install
npm run demo

GIF of demo

Configuration

Overview

  • SECTION a section of continuos PIXELS on a strip
    has one:

    • TASK something to do (HTTP request, shell command)
      has one:
      • COMPARISON rule(s) to compare against result of a TASK (expect)
        has one:
        • REACTION a state to set on the SECTION
  • STATE what to with the PIXELS of a SECTION (set them to a color)

JSON object

See the "Full" (JSON, YAML) and "Minimal" (JSON, YAML) example configuration files and consult this description should questions arise. The "Full" example has two sections, the first is the most minimal, the other is the most verbose config for a section.

  • colors: Object. Keys are names of colors to be used in rest of config, values are valid CSS color strings (names, hex, hsl, …).

  • sections: Array of Objects with keys:

    • id: unique short name of section (word-characters allowed)
    • description: optional description of the section
    • start: the first pixel which belongs to the section, it will go to the end or one pixel before the next section
    • a key for one of the runners, like:
      • command: run a shell command
      • request: make a HTTP request
    • expect: hash of expectations on (at least one of) the following values (see below for possible expectations):
      • status: exit status of command, or http status of request
      • output: stdout of command, or res of request
      • error: stderr of command, or err of request
  • ok: if assert was true, set section to this color

  • fail: if assert was false, set section to this color

Tasks

request

Make a HTTP request powered by the request module.

See API there, short synopsis below.

  1. Setting it to an URL string makes a GET request to this URL.

    {
      "request": "http://example.com"
    }
  2. Setting it to an hash enables all the bells and whistles:

    {
      "request": {
        "method": "GET",
        "url": "https://example.com",
        "qs": { "query": "foobar" },
        "auth": {
          "user": "username",
          "pass": "password",
          "sendImmediately": false
        },
        "headers": {
          "User-Agent": "pixelstatus"
        }
      }
    }

Comparisons

The is only one option at the moment:

expect

Can be in one of the following forms

  • simple value (number, string): must be exactly equal to compared value
  • hash of "comparators" from the ruler module and the value to compare.

CLI

./draft.coffee examples/config.json -vv

config

First argument must be the path to a config file. It can be a JSON-file as described above, or (structurally equivalent) YAML.

loglevel

Set console log level by appending one or more -v's. -v is 'info', -vv is 'verbose', -vvv is 'debug'.

Credits

The whole project uses lots of great free/open modules and projects:

It is written in CoffeScript.