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

@cloud-cli/on

v0.1.9

Published

CLI entry point for the on plugin ecosystem.

Downloads

926

Readme

Workflow Design

This is a task runner using webhooks to process incoming events.

Every event is sent to a daemon as an HTTP request, with a JSON body, and can trigger one or more workflows. Every workflow is a set of steps, which can run on containers or in a shell on the host.

Running on Docker

  • Steps run inside a docker container.
  • All steps run in the same workspace folder.
  • The current folder is mounted as a volume at /workspace by default. This can be changed by specifying a volume with . as the host path.

Running on the host machine

  • Steps are sent as stdin to a shell subprocess

General configuration syntax

Running with Docker:

curl -X POST http://localhost:11235/ -d '{ "event-name": {...} }'
description: Run tests and build

vars: &vars
  image: node:latest

on:
  event-name:
    runner: docker
    if:
      - ${inputs.action} == 'published'
    secrets:
      - /path/to/secrets
      - /path/to/.env
    mappings:
      <field>: <path.to.value.in.inputs>
    env:
      A_SECRET: "${secrets.A_SECRET}"
      A_VALUE: "${inputs.some.value}"
    defaults:
      <<: *vars
      volumes:
        .: /home
        /dev/shm: /dev/shm
      args:
        net: host
        dns: 1.2.3.4
    steps:
      - pnpm i
      - pnpm run build
      - pnpm run test
    triggers:
      - path/to/output.json

Running with a shell on the same machine as the server:

curl -X POST http://localhost:11235/ -d '{ "package": {...} }'
description: Auto-release library
on:
  event-name:
    runner: shell
    secrets:
      - /path/to/secrets
      - /path/to/.env
    mappings:
      <field>: <path.to.value.in.json.payload>
    env:
      A_SECRET: "${secrets.A_SECRET}"
      A_VALUE: "${inputs.some.value}"
    steps:
      - pnpm i
      - pnpm run build
      - pnpm run release
    triggers:
      - path/to/output.json

Event Payload

The webhooks can have any shape. To match events to workflows, we look for the top-level keys in the request body, and matching workflows that expect them to be present.

For example, given the request:

curl -X POST http://localhost:11235/ -d '{ "published": { "value" : 123 } }'

Then the workflow should map the published key:

on:
  published:
    steps:
      - echo ${inputs.value}

Here, the expression inputs in the workflow context is defined as the value set in the published key from the parsed JSON. The expression ${inputs.value} contains 123.

To differentiate between events coming from the same place, multiple webhooks can be created. The incoming webhook URL can have a path, and that is considered as the event source.

Consider this request:

curl -X POST http://localhost:11235/source -d '{ "event": { "value" : 123 } }'

The key source is added to the event payload. The workflow should now be defined as:

on:
  source:
    published:
      steps:
        - echo ${inputs.value}

This difference in payload processing allows multiple webhooks from the same source, to separate different events with a similar JSON body.

Secrets

The daemon can fetch secrets from its host environment, or from a file.

Inputs

Inputs are defined from the incoming JSON payload. The payload is parsed and made available as the inputs variable

Mappings

These are shortcuts to make scripting easier.

After the JSON payload is parsed, these mappings are evaluated, and added to inputs as shortcuts for long/deep properties in the payload.

For example: from a GitHub webhook event that contains a lot of fields, we can define image from package.package_version.package_url

mappings:
  image: ${inputs.package.package_version.package_url}

Environment variables

After resolving secrets and mappings, we proceed to resolve env variables from template strings or literal strings.

An env variable is interpreted a JS template string, with ${value} syntax used to interpolate values from inputs or secrets.

Sequence of operation

For every incoming event, these steps are followed:

  • Parse and validate payload
  • Load secrets
  • Map inputs
  • Populate env with secrets
  • Populate env with additional workflow definitions (section env)
  • Create a temporary working directory
  • Add a volume to defaults at /workspace, or a custom path, if a volume with a host path . is defined in the workflow
  • Run steps:
    • For every step, either a string, or a step definition is accepted.
    • If string, run with the defaults defined in the workflow
    • If a definition, merge defaults into it, and run the step
    • The step is a shell command, executed inside a short-lived container
  • Trigger new events

Triggers

After steps are executed, a list of one or more JSON files can be defined to trigger new workflows.

These files are read one by one and sent back to the daemon as new events.