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

@lowdep/json-validate

v1.0.0

Published

Validate JSON data against a JSON Schema (draft-07 core) — readable errors, CI-friendly, zero dependencies

Readme

json-validate

Zero dependencies Node License: MIT Platform

Validate JSON data against a JSON Schema (draft-07 core) with readable error messages. Zero dependencies.

The natural companion to json-schema-gen: generate a schema from a sample, then enforce it in CI. Unlike ajv-cli, this pulls in no dependencies.


Install

npm install -g json-validate

Or without installing:

npx json-validate schema.json data.json

Usage

json-validate schema.json data.json                    # Validate one file
json-validate schema.json user1.json user2.json        # Validate several
json-validate -s schema.json data.json --quiet         # Exit code only
json-validate schema.json data.json --json             # Machine-readable

Example

schema.json:

{
  "type": "object",
  "required": ["id", "email", "age"],
  "properties": {
    "id":    { "type": "string", "format": "uuid" },
    "email": { "type": "string", "format": "email" },
    "age":   { "type": "integer", "minimum": 0, "maximum": 120 },
    "role":  { "enum": ["admin", "user", "guest"] }
  },
  "additionalProperties": false
}

data.json:

{ "id": "not-a-uuid", "email": "bad", "age": 200, "role": "wizard", "extra": true }

Running json-validate schema.json data.json:

json-validate  schema: schema.json

  ✗ data.json  5 errors
      .id     is not a valid uuid
      .email  is not a valid email
      .age    must be <= 120 (is 200)
      .role   must be one of ["admin","user","guest"]
      (root)  additional property 'extra' is not allowed

  0 valid  1 invalid

Supported Keywords

| Category | Keywords | |---|---| | Core | type, enum, const | | Object | required, properties, patternProperties, additionalProperties, minProperties, maxProperties | | Array | items (incl. tuples), minItems, maxItems, uniqueItems | | Number | minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf | | String | minLength, maxLength, pattern, format | | Combinators | allOf, anyOf, oneOf, not |

Formats: date-time, date, time, email, uri, uuid, ipv4, ipv6, hostname


CI Integration

- name: Validate config against schema
  run: npx json-validate config.schema.json config.json --quiet

Exit codes:

  • 0 — all data files valid
  • 1 — at least one invalid
  • 2 — file missing or malformed JSON

Scope

This validates the draft-07 core keywords listed above — covering the vast majority of real-world schemas. It does not resolve $ref/$defs or remote references; keep schemas self-contained. For full draft-2020-12 + $ref resolution, use ajv.


License

MIT


Keywords

json schema validator · validate json · ajv alternative · ajv-cli alternative · json validation · draft-07 · schema check · validate against schema · zero dependencies · ci


Built to solve, shared to help — Rushabh Shah 🛠️✨

One of 40+ zero-dependency developer CLI tools — no node_modules, ever.