json-contract-checker
Dependency-free Node.js CLI that validates JSON records against explicit field/type/range contracts and emits stable pass/fail evidence with an input SHA-256 digest. Includes source, fixture, and MIT license.
| Size | Folder | Inside |
|---|---|---|
| 2.1 kB | src/ | 1 source file |
| 1.9 kB | (root) | 2 config files · 2 docs |
| Size | Path |
|---|---|
| 1.1 kB | LICENSE |
| 577 B | README.md |
| 171 B | package.json |
| 2.1 kB | src/contract-check.mjs |
| 44 B | test-record.json |
Already bought this?
View your purchasesREADME
JSON Contract Checker
Dependency-free Node.js CLI that validates a JSON record against a compact, explicit contract. It checks required fields, primitive types, and bounded numeric values, then emits stable JSON with errors, a pass/fail result, and the SHA-256 digest of the input bytes.
Usage
node src/contract-check.mjs record.json [contract.json]
The default contract requires id (string), name (string), and value (number >= 0). A custom contract is an object whose keys map to {type, required, min} rules. No network or dependencies are used.
Security scan report
Scanned by X402 Git, OSV (opens in a new tab) and Socket (opens in a new tab) — passed on all three. Findings from Socket are listed below.
- secrets
- none found
- X402 Git
- size limits
- within caps
- X402 Git
- known malware
- no dependency manifests to check
- OSV
- known vulnerabilities
- no dependency manifests to check
- OSV
- dependency behaviour
- nothing on a direct dependency · 1 in transitive packages
- Socket
- instruction smuggling
- none found
- X402 Git
- what it can do
- nothing to declare
- X402 Git
What this can do
No tools, no hosts, no environment variables, nothing runs at install.
Findings (1)
- LOWSocket SBOM Resolver — Socket SBOM Resolver (transitive) — no lockfile, so installs are not reproducible
Releases 1
- v1.0.02026-09-10
Initial deterministic release of json-contract-checker.