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

@hia-doc/jsondoc

v1.0.0

Published

Lossless JSON resource documentation and exact source provenance for HIA.

Readme

@hia-doc/jsondoc

Generate complete JSON resource documentation with HIA core documents and exact source maps. Objects, arrays, unknown fields and scalar lexemes retain their original identities and source positions.

中文摘要。本包为JSON资源生成完整值树文档和精确来源。原始数值、特殊键、数组和未知字段均保留,调用方负责授权与公开审查。

Install

npm install @hia-doc/jsondoc

Requires Node.js ^22.23.4 || ^24.22.1. Package version 1.0.0 is a release candidate in the source distribution. Registry availability follows the release manifest.

In-memory API

import { generateJsonDocumentation } from '@hia-doc/jsondoc';

const result = generateJsonDocumentation(
  '{"count":9007199254740993,"values":[true,null]}',
  { path: 'schemas/example.json', locale: 'en' }
);

// HIA core 1.0.0, doc-source-map 1.1.0, and one unchanged source text.
console.log(result.document, result.sourceMap, result.sourceText);

locale explicitly identifies the actual content language. Values retain their original text. Translation is supplied by the resource owner. Each value becomes a symbol and navigation node, identified by the resource path and RFC 6901 JSON Pointer. Scalar metadata.json.lexeme preserves numeric precision, exponent spelling, negative zero and original string escaping. Containers retain ordered children. sourceText holds the complete original resource once.

Source positions use one-based physical CRLF/LF/CR lines, one-based UTF16 columns and exclusive endpoints. The source map declares utf16-code-unit. Unicode separators inside JSON strings retain their physical column positions.

$ref and $dynamicRef occurrences retain their original values and pointer context as lexical-occurrence. Schema vocabulary evaluation and reference traversal require a separately verified schema-aware consumer. Processing performs no network requests.

SDK producer

import { jsonDocumentationProducer } from '@hia-doc/jsondoc';
import { runDocumentationProducer } from '@hia-doc/plugin-sdk';

const result = await runDocumentationProducer(jsonDocumentationProducer, {
  workspaceRoot: '/authorized/project',
  outputDirectory: '/authorized/output',
  inputs: [{ kind: 'json-resource', path: 'schemas/example.json', locale: 'en' }]
});

The producer writes a unique batch directory containing a core document, a source map and an exact .source.json snapshot per input. It processes resources individually, validates the SDK result and commits the batch by renaming its staging directory. Failed batches remove their own staging directory. Concurrent calls and retries retain independent batches. Cancellation is checked before each resource and before commit. The SDK may report late cancellation after a completed filesystem commit, so callers retain responsibility for abandoned successful batches.

The existing hia docs build --project-manifest loader accepts the built module and exportName: "jsonDocumentationProducer" as an explicit producer. The manifest uses inputs with the same kind, path and locale fields.

Input and publication boundaries

Inputs use strict UTF8 and JSON. Comments, trailing commas, BOMs, duplicate decoded object keys and malformed text are rejected. Each resource is limited to 4MiB, 128 container levels, 250,000 syntax tokens and 100,000 values. Aggregate per-value path and JSON Pointer length is limited to 2,000,000 UTF16 units per resource to bound expansion of deeply nested long keys. Public resource paths are limited to 4,096 UTF16 units. A producer batch accepts at most 100 explicit inputs.

File inputs must be single-link regular files beneath the authorized root. Directory junctions, symlinks, traversal and concurrent file changes are rejected. Output parents undergo physical-path checks. Diagnostics omit raw input and operating-system exception text.

The complete resource, including examples and unknown fields, appears in the generated content and source snapshot. Callers must review those resources for public disclosure. Runtime authorization comes from the host. API type declarations and package availability do not grant publication permission.

License

MIT. JSON parsing uses Microsoft's [email protected] under MIT.