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

jsonck

v1.0.1

Published

Validate JSON files against JSON schemas. Supports stdin, batch, local/remote schemas, and structured JSON output.

Readme

jsonck

npm version license node

One command to validate any JSON file against any JSON Schema.

Zero config when your files have $schema. Pipes, globs, remote schemas, and structured JSON output all work out of the box.

npx jsonck data.json
# ✓ valid

Why jsonck?

  • Zero config — reads $schema from your JSON files automatically
  • Pipes & globscurl ... | jsonck --schema url or jsonck *.json
  • JSON output--json gives structured results for scripts, CI, and LLM tool calls
  • Fast — single Ajv instance with schema caching, no startup overhead
  • Tiny — 5 modules, 4 runtime dependencies, nothing bloated

Quick Start

# No install needed
npx jsonck config.json

# Or install globally
npm install -g jsonck

Requires Node.js >= 20.

Examples

Validate using embedded $schema

jsonck data.json

If the JSON file contains "$schema": "https://...", jsonck downloads and validates against it automatically.

Specify a schema explicitly

# Local file
jsonck data.json --schema ./schemas/my-schema.json

# Remote URL
jsonck data.json --schema https://example.com/schema.json

The --schema flag always overrides any $schema in the file.

Pipe from stdin

cat data.json | jsonck --schema ./schema.json
curl -s https://api.example.com/data | jsonck --schema ./schema.json
jq '.config' big.json | jsonck - --schema ./config-schema.json

Batch validate

jsonck *.json --schema ./schema.json

Structured JSON output

Perfect for CI pipelines, scripts, and LLM tool integrations:

jsonck data.json --schema ./schema.json --json
{
  "file": "data.json",
  "valid": false,
  "errors": [
    { "path": "/name", "message": "must be string" },
    { "path": "/age", "message": "must be >= 0" }
  ]
}

Multiple files produce a JSON array.

Use in scripts

if jsonck data.json --schema ./schema.json; then
  echo "Deploying..."
else
  echo "Fix your config first."
  exit 1
fi

Reference

jsonck [files...] [options]

Arguments

| Argument | Description | |----------|-------------| | [files...] | JSON files to validate. Use - for stdin. Omit to auto-read piped input. |

Options

| Option | Description | Default | |--------|-------------|---------| | -s, --schema <path-or-url> | Schema file path or URL. Overrides $schema in files. | — | | --json | Structured JSON output to stdout | false | | --timeout <ms> | Timeout for remote schema downloads | 30000 | | -V, --version | Print version | — | | -h, --help | Print help | — |

Exit Codes

| Code | Meaning | |------|---------| | 0 | All files valid | | 1 | One or more files invalid | | 2 | Runtime error (missing file, bad JSON, no schema, network timeout) |

Output Modes

Text (default) — human-readable. Prints Valid/Invalid to stdout/stderr. Batch mode prefixes each line with the filename.

JSON (--json) — machine-readable. Single file → JSON object. Multiple files → JSON array. Errors are inline, not on stderr. Recommended for scripts, CI, and LLM tool calls.

Schema Resolution

  1. --schema flag (always wins)
  2. $schema property in the JSON file
  3. Error if neither is found

Schemas are cached per invocation — validating 100 files against the same remote schema downloads it once.

LLM Integration

jsonck is designed to work as a tool in LLM agent workflows. Use --json for structured output that's easy to parse:

jsonck config.json --schema https://example.com/schema.json --json

Returns a JSON object with file, valid, and errors fields. Exit code 0 means valid, 1 means invalid, 2 means something broke. No interactive prompts, no color codes in JSON mode — clean machine-readable output.

Development

npm run build        # tsc → dist/
npm test             # vitest (build first — CLI tests exec dist/cli.js)
DEBUG=jsonck jsonck data.json  # debug logging

License

MIT