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

@granularjs/cli

v0.1.1

Published

Umbrella CLI for the Granular ecosystem. Dispatches to @granularjs/lint, @granularjs/codemods and @granularjs/create-app under a single `granular` command.

Readme

@granularjs/cli

Umbrella CLI for the Granular ecosystem. Exposes a single granular command that dispatches to the dedicated tooling packages:

| Subcommand | Delegated to | Purpose | |---|---|---| | granular lint | @granularjs/lint | Lint Granular code | | granular audit | @granularjs/lint | Aggregated lint report | | granular create | @granularjs/create-app | Scaffold a new app | | granular migrate | @granularjs/codemods | Convert a React project to Granular | | granular docs | @granularjs/core | Serve the module docs viewer locally |

@granularjs/core itself stays runtime-only and dependency-free. All tooling lives here or in the dedicated packages above.

Install

Globally (recommended for casual use):

npm install -g @granularjs/cli
granular --help

Or per-project:

npm install --save-dev @granularjs/cli
npx granular --help

Migrating from @granularjs/core 2.x? The granular bin used to ship with @granularjs/core. Starting with @granularjs/core 3.x it lives in this package. Uninstall the old global if you have it, then install @granularjs/cli:

npm uninstall -g @granularjs/core
npm install -g @granularjs/cli

Usage

granular <command> [options]

Commands:
  lint <path ...>             Lint Granular code (delegates to @granularjs/lint)
  audit <path ...>            Aggregated lint report across files
  create <appName> [options]  Scaffold a new app (delegates to @granularjs/create-app)
  migrate <source> [options]  Convert a React project to Granular (delegates to @granularjs/codemods)
  docs [--port N] [--open]    Serve the Granular module docs viewer locally

Options:
  -h, --help                  Show this help
  -v, --version               Show CLI version

granular lint

Forwards every argument to the granular-lint binary from @granularjs/lint. Run granular lint --help for the full list of options.

granular lint .
granular lint src --format=json
granular lint --list-rules

granular audit

Runs granular-lint --format=json against the given paths (defaults to .) and produces an aggregated report:

Granular Audit Report
=====================
Files analyzed:     124
Files with issues:  17
Total errors:       2
Total warnings:     31

Findings by rule:
  no-state-truthy-and                       8
  no-get-at-top-of-list-render              7
  prefer-list-over-map                      6
  ...

granular create

Forwards arguments to the create-granular-app binary from @granularjs/create-app.

granular create my-app
granular create my-app --jsx
granular create my-app --ssr

granular migrate

Wraps the codemods + project rewrites pipeline from @granularjs/codemods. Always writes to a NEW folder so the source tree stays intact for diffing.

granular migrate ./my-react-app
granular migrate ./my-react-app --out ./my-granular-app
granular migrate ./my-react-app --dry-run
granular migrate ./my-react-app --steps deps,config

Run granular migrate --help for the full list of steps and codemods.

granular docs

Serves the Granular module docs viewer over HTTP. Reads markdown from @granularjs/core/docs/modules (which ships with core 3.x).

granular docs
granular docs --port 4000 --open

Programmatic API

import { dispatch, printUsage, readVersion } from '@granularjs/cli';
import { runMigrate } from '@granularjs/cli/migrate';
import { runDocs } from '@granularjs/cli/docs';

await dispatch('lint', ['src']);
await runMigrate(['./my-react-app', '--dry-run']);
await runDocs(['--port', '4000']);

Why an umbrella CLI?

Before 0.1.0, the granular binary lived inside @granularjs/core. That coupled the runtime to Babel parser/traverse and tied global installs to tooling versions, in violation of the core's "zero runtime dependencies" rule.

Splitting the CLI out lets each tool ship and version independently while still presenting users with a single, familiar granular command.

License

Apache-2.0. Same as @granularjs/core.