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

@notrealstudio/nr-json5

v0.1.1

Published

JSON5 microcodec: full reader (json5-tests green), canonical single-line relaxed writer. Zero dependencies.

Readme

nr-json5

A JSON5 reader and a canonical single-line writer, with no dependencies and nothing else in the box.

import { parseJson5, stringifyJson5 } from '@notrealstudio/nr-json5'

parseJson5("{ model: 'gpt-4o', /* trailing commas fine */ steps: 30, }")
// → { model: 'gpt-4o', steps: 30 }

stringifyJson5({ model: 'gpt-4o', steps: 30 })
// → "{model: 'gpt-4o', steps: 30}"

The reader is a port of the reference implementation (json5 2.2.3, MIT) — the same state machine, so the official json5-tests suite stays green: comments, unquoted keys, single quotes, trailing commas, hex, leading and trailing decimal points, +/-, Infinity, NaN, escaped and multi-line strings. Two deliberate departures: identifier and space character classes use Unicode property escapes instead of the reference's 15 KB of tables frozen at Unicode 9, and there is no reviver — parser state is per-instance rather than module-global.

The writer is not a port. It emits canonical relaxed JSON5 on one line: bare keys where the key is an ASCII identifier, single-quoted strings, one space after : and ,, no trailing comma. Deterministic — two callers emit identical bytes, which is what makes it safe to diff, to compare, and to embed in a line-oriented format. It mirrors JSON semantics for toJSON, and for undefined, functions and symbols (dropped from objects, null inside arrays); it throws a TypeError on a circular structure, on a BigInt, and on a top-level value with no JSON5 representation.

Install

npm install @notrealstudio/nr-json5

Zero dependencies, no host APIs — Node, browsers, Google Apps Script, userscripts, anywhere with a modern JS engine. A parse error is a SyntaxError carrying lineNumber and columnNumber, so you can point at the offending character.

License

MIT. The reader derives from json5 (c) 2012-2018 Aseem Kishore and others, also MIT.