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

@asymmetric-effort/jsonlint

v0.0.5

Published

A pure JavaScript/TypeScript JSON parser and validator with detailed error reporting — zero dependencies

Readme

@asymmetric-effort/jsonlint

A pure TypeScript JSON parser, linter, and validator with detailed error reporting. Zero runtime dependencies.

Feature-compatible with zaach/jsonlint.

Installation

NPM Package

npm install @asymmetric-effort/jsonlint

Global CLI

npm install -g @asymmetric-effort/jsonlint

Standalone Binary

Pre-compiled standalone binaries are produced via make build. The binary requires no runtime dependencies.

CLI Usage

jsonlint myfile.json

Or pipe JSON via stdin:

echo '{"key": "value"}' | jsonlint

Options

| Flag | Long Form | Description | Default | |------|-----------|-------------|---------| | -v | --version | Print version and exit | | | -s | --sort-keys | Sort object keys in output | false | | -i | --in-place | Overwrite the input file with formatted output | false | | -t CHAR | --indent CHAR | Character(s) to use for indentation | " " (2 spaces) | | -c | --compact | Compact error display | false | | -V FILE | --validate FILE | Validate against a JSON Schema (Draft-03) file | | | -e ENV | --environment ENV | JSON Schema spec version | json-schema-draft-03 | | -q | --quiet | Do not print parsed JSON to stdout | false | | -p | --pretty-print | Force pretty printing even if invalid | false | | -h | --help | Show help message | |

Examples

Validate and pretty-print:

jsonlint data.json

Sort keys:

jsonlint -s data.json

Format in place:

jsonlint -i data.json

Validate against a schema:

jsonlint -V schema.json data.json

Compact errors (useful for editor integrations):

jsonlint -c data.json

Module API

import { parse } from "@asymmetric-effort/jsonlint";

// Returns parsed value or throws ParseError
const result = parse('{"key": "value"}');

Advanced Usage

import { JsonParser, ParseError, LexerError } from "@asymmetric-effort/jsonlint";

const parser = new JsonParser();

// Custom error handler
parser.parseError = (message, hash) => {
  console.error(`Error at line ${hash.line}: ${message}`);
  throw new ParseError(message, hash);
};

try {
  parser.parse(input);
} catch (e) {
  if (e instanceof ParseError) {
    console.error("Parse error:", e.hash);
  } else if (e instanceof LexerError) {
    console.error("Lexer error:", e.message);
  }
}

Formatter

import { formatJson } from "@asymmetric-effort/jsonlint";

// Best-effort formatting (works even on invalid JSON)
const formatted = formatJson('{"a":1,"b":2}', "  ");

Schema Validator

import { SchemaValidator } from "@asymmetric-effort/jsonlint";
import type { JsonSchema } from "@asymmetric-effort/jsonlint";

const schema: JsonSchema = {
  type: "object",
  properties: {
    name: { type: "string", required: true },
    age: { type: "integer", minimum: 0 },
  },
};

const validator = new SchemaValidator();
const errors = validator.validate({ name: "Alice", age: 30 }, schema);

if (errors.length > 0) {
  errors.forEach((e) => console.error(`${e.property}: ${e.message}`));
}

Building

make setup    # Install dependencies
make build    # Build library and standalone binary
make test     # Run all tests
make lint     # Run type checker
make help     # Show all targets

License

MIT License. Copyright (c) 2026 Asymmetric Effort, LLC.