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

@intelpacket/core

v0.1.0

Published

Deterministic structured-data packetization, replay verification, deduplication, compaction, and integrity engine for JSON-like structured systems.

Readme

IntelPacket Core

Package: @intelpacket/core

Deterministic structured-data packetization for Node.js: normalize → canonicalize → compact → dedupe → optional delta metadata → compress → SHA-256 hash → versioned packet shell → verified replay.

IntelPacket is an embeddable library: it turns JSON-compatible trees into canonical, hashed, compressible packets with lossless replay. It does not define a transport protocol, binary wire interchange standard, or semantic analysis of payload content.

Formal spec: IntelPacket Specification v1
Suite limitations: Limitations & Non-Goals

Integrity Hardening

Core integrity tests cover golden vectors, tamper/corruption matrices, seeded fuzz and malformed input, schema drift, version compatibility, concurrency, soak smoke cycles, npm pack smoke checks, and a CI-sized benchmark smoke gate.

Run from the repo root:

pnpm run test:integrity
pnpm run verify:integrity

Strict 100k benchmarks are manual only and are not run by CI.

Install

npm install @intelpacket/core

Optional pnpm/yarn equivalents: pnpm add @intelpacket/core or yarn add @intelpacket/core.

Requires Node.js 18+.

What the engine does

  • Deterministic canonicalization — Lexicographic object key order; stable UTF-8 serialization for the inner hashing body.
  • Compaction — Optional short-key dictionary merged with defaults; expanded on replay using metadata.compaction_dictionary plus defaults.
  • Dedupe — Repeated subtrees become stable __ip_ref pointers; inner refs table is authoritative for replay.
  • Delta metadata — When createPacket(input, { base }) is used, a deterministic patch map is stored alongside the full next root (not delta-only storage).
  • Compression — Brotli preferred, zlib fallback, or none when disabled.
  • Hashing — SHA-256 over the canonical inner hashing body (ip_version, encoding, root, refs, delta). created_at and outer compression metadata are not hashed.
  • Replay verificationverifyIntelPacket (boolean, fail-closed) and replayPacket (throws on hash mismatch by default) decompress, validate, expand inner refs only, then expand compaction.

Examples (repository)

From the monorepo root after pnpm install:

pnpm exec tsx examples/core/basic-packet.ts
pnpm exec tsx examples/core/replay-verify.ts
pnpm exec tsx examples/core/canonicalization.ts
pnpm exec tsx examples/core/dedupe.ts

createPacket / replayPacket / verifyIntelPacket

import { createPacket, replayPacket, verifyIntelPacket } from "@intelpacket/core";

const packet = createPacket({ a: 1, z: 2 }, { disableCompression: true });
if (!verifyIntelPacket(packet)) throw new Error("bad packet");
const { expanded } = replayPacket(packet);

Canonicalization

import { canonicalize, canonicalStringify } from "@intelpacket/core";

const c = canonicalize({ z: 1, a: { m: 2, b: 3 } });
console.log(canonicalStringify(c));

Compaction helpers

import { compactSchema, expandSchema } from "@intelpacket/core";

const dict = { timestamp: "ts" };
const compacted = compactSchema({ timestamp: "2020-01-01T00:00:00.000Z" }, { dictionary: dict });
const round = expandSchema(compacted, { dictionary: dict });

Dedupe

import { dedupeStructures, expandRefs } from "@intelpacket/core";

const shared = { k: 1, j: 2 };
const d = dedupeStructures({ a: shared, b: shared });
expandRefs(d.value, d.refs);

Deterministic guarantees

  • Same logical input and equivalent options ⇒ same inner hashing body and packet_hash (subject to documented normalization rules; see docs/determinism.md).
  • Dedupe ref identifiers are stable for identical structural fingerprints.
  • Outer refs mirrors inner refs for convenience; replay MUST use inner refs only (see spec §7).

Replay guarantees

  • Default replayPacket verifies packet_hash before expansion.
  • Expansion is depth-first and deterministic; missing refs or cycles beyond limits throw.

Versioning

  • assertSupportedIntelPacketVersion, INTELPACKET_SPEC_VERSION, and related constants are exported for tooling.
  • Unknown spec_version values (when present) are rejected.

Non-goals

  • Not machine learning, knowledge graphs, ledgers, hosted observability products, or shared storage.
  • Not field-level privacy transforms (use @intelpacket/pii upstream if needed).

Benchmarking

  • Throughput: pnpm run bench (compression bench), pnpm run bench:50x.
  • Realistic proof run: pnpm run bench:realistic — loads benchmarks/datasets/realistic/*.json, checks five-run packet_hash equality, verifyIntelPacket, and replay round-trip (createPacket(replay.normalized) matches original hash). Writes benchmark-results.json and BENCHMARK_REPORT.md.
  • Advanced stress bench: pnpm run bench:advanced — entropy-class synthetic payloads, gzip/brotli baselines, percentiles, memory deltas; JSON + CORE_ADVANCED_REPORT.md. Large --scale=100k / 1m runs use a soft row cap unless you pass --strict-scale (see report / JSON cli).

Dataset methodology

Fixtures are synthetic (SaaS-style APIs, logs, traces, configs, audits, transactions, telemetry). Regenerate with pnpm run datasets:realistic. See benchmarks/datasets/realistic/README.md.

Determinism & replay validation

Documented in benchmarks/README.md. The realistic runner fails closed if determinism, verify, or replay round-trip breaks.

Further reading

License

MIT — see LICENSE.