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

@flux-lang/cli

v0.1.5

Published

CLI tooling for the Flux score language

Readme

@flux-lang/cli

Command-line tools for the Flux score language.

This package provides the flux binary, built on top of @flux-lang/core, with:

  • flux parse – parse Flux source files and print their IR as JSON.
  • flux check – parse + run basic static checks (grids, neighbors, timers).

Flux is a small, declarative language for procedurally evolving music scores and parts. See the main repo for the full IR and language spec.


Installation

Global install:

npm install -g @flux-lang/cli

Project-local (dev) install:

npm install --save-dev @flux-lang/cli

You can also use npx without installing globally.


Commands

flux parse

Parse one or more .flux files and print their IR as JSON.

flux parse example.flux

For a single file, the default output is pretty-printed JSON, e.g.:

{
  "meta": {
    "version": "0.1.0",
    "title": "Example"
  },
  "state": {
    "params": []
  },
  "grids": [],
  "rules": []
}

Options:

  • --ndjson – emit one JSON object per line { "file", "doc" } (always used when parsing multiple files).
  • --pretty – always pretty-print JSON (2-space indent).
  • --compact – compact JSON with no extra whitespace.

You can also read from stdin using -:

cat example.flux | flux parse -

Note: - (stdin) can only be used by itself (not mixed with other file paths).


flux check

Parse .flux files and run basic static checks:

  • Unknown grid references in rule scopes.
  • Unsupported neighbors.* methods.
  • Obvious runtime timer issues (timer(...) amount must be positive).
  • A light initRuntimeState smoke-check to catch obviously invalid IR.

Basic usage:

flux check example.flux

If all files are OK:

✓ 1 files OK

If some fail, diagnostics go to stderr and a summary to stdout:

# stderr
example.flux:0:0: Check error: Rule 'oops' references unknown grid 'notAGrid'

# stdout
✗ 1 of 1 files failed checks

JSON / NDJSON output

You can get machine-readable diagnostics via:

flux check --json example.flux

This emits one JSON line per input file:

{"file":"example.flux","ok":false,"errors":[{"message":"example.flux:0:0: Check error: Rule 'oops' references unknown grid 'notAGrid'"}]}

Using with npm scripts / CI

Example package.json snippets:

{
  "scripts": {
    "flux:parse": "flux parse src/scores/*.flux",
    "flux:check": "flux check src/scores/*.flux"
  }
}

In CI, you can simply run:

npx flux check src/scores/*.flux

and treat a non-zero exit code as a failure.


Relationship to @flux-lang/core

@flux-lang/cli is a thin wrapper around @flux-lang/core:

  • flux parse calls parseDocument and prints the FluxDocument IR.
  • flux check uses both the parser and checkDocument to validate documents.

If you want to embed Flux directly in a tool or runtime, prefer @flux-lang/core. If you want to wire Flux into scripts, CI, or quick local checks, use @flux-lang/cli.


License

MIT – see the LICENSE file in the repo root.