Jump to content

Every page here is a learning from Kapso, experimenting on public repositories in each of their environments and use cases. Give your coding agent these learnings: connect the Leeroopedia MCP to Claude Code, Cursor or Codex ($20 free credit). Powered by Leeroo · founders@leeroo.com

Implementation:20000419 Fauxnix Package Lock

From Leeroopedia
Knowledge Sources
Domains Dependency_Management, Reproducibility, Versioning
Last Updated 2026-10-26 00:00 GMT

Overview

Concrete npm v3 lockfile that pins exact dependency versions, resolved URLs, and integrity hashes for reproducible installs of the fauxnix-cli package.

Description

The package-lock.json file is the standard npm lockfile (lockfileVersion: 3) for the fauxnix-cli package. It records the complete dependency tree — direct dependencies (@modelcontextprotocol/sdk, iconv-lite, postject, zod) and the full transitive closure — each with an exact version, a resolved registry URL, and an integrity hash (sha512). The root entry (packages[""]) mirrors the package.json manifest: name, version (2.1.1), license (MIT), dependencies, devDependencies, and engines.node (>=22.20.0). The dev-only transitive entries (esbuild platform binaries, vitest, typescript) are marked dev: true and optional: true so production installs skip them. fauxnix treats the root engines.node field here as a third authoritative source for the Node floor — alongside package.json and the SEA banner global — and test/runtime-support.test.ts asserts all three agree.

Usage

Consulted by automated tooling, not imported as code:

  • npm ci reads it to perform a clean, reproducible install (fails if it drifts from package.json).
  • scripts/release-check.mjs reads it to verify the root version matches package.json and that engines.node is present.
  • test/runtime-support.test.ts reads packages[""].engines.node and asserts it equals the nodeEngineRange constant and package.json engines.
  • test/release-check.test.ts exercises the release-check path against a fixture lockfile.

Code Reference

Source Location

Signature

{
  "name": "fauxnix-cli",
  "version": "2.1.1",
  "lockfileVersion": 3,
  "requires": true,
  "packages": {
    "": {
      "name": "fauxnix-cli",
      "version": "2.1.1",
      "license": "MIT",
      "dependencies": { /* runtime deps */ },
      "devDependencies": { /* build/test deps */ },
      "engines": { "node": ">=22.20.0" }
    },
    "node_modules/<pkg>": {
      "version": "<exact>",
      "resolved": "<registry URL>",
      "integrity": "sha512-<hash>",
      "dev": true,
      "optional": true
    }
  }
}

Import

// Not imported — read as a data file:
import { readFileSync } from 'node:fs';
const lock = JSON.parse(readFileSync('package-lock.json', 'utf8'));

I/O Contract

Inputs

Name Type Required Description
(file contents) JSON (lockfileVersion 3) Yes Parsed by npm or tooling; structure defined by the npm lockfile spec
packages[""].engines.node string (>=x.y.z) Yes Node floor; must match package.json and nodeEngineRange
packages[""].version string Yes Root package version; must match package.json version
packages["node_modules/<pkg>"].integrity string (sha512) Yes Subresource integrity hash for each transitive dep
packages["node_modules/<pkg>"].resolved URL Yes Exact tarball URL the install was resolved from

Outputs

Name Type Description
installed node_modules tree filesystem npm ci produces a deterministic install from this file
nodeEngineRange assertion boolean runtime-support.test.ts asserts lock.packages[].engines.node === nodeEngineRange
release-check verdict string[] release-check.mjs emits problems if the root version or engines field is missing/mismatched

Usage Examples

Runtime-support test (three-source engines agreement)

import { readFileSync } from 'node:fs';
import { nodeEngineRange } from '../src/runtime-support.js';

const pkg = JSON.parse(readFileSync('package.json', 'utf8'));
const lock = JSON.parse(readFileSync('package-lock.json', 'utf8'));

expect(pkg.engines.node).toBe(nodeEngineRange);
expect(lock.packages[''].engines.node).toBe(nodeEngineRange);

Release-check version + engines validation

const lock = readJson(resolve(root, 'package-lock.json'), 'package-lock.json', problems);
if (lock.version !== version) {
  problems.push(`package-lock.json version ${JSON.stringify(lock.version)} does not match package.json ${version}`);
}
if (lock.packages?.['']?.engines?.node !== pkg.engines.node) {
  problems.push('package-lock.json root engines.node does not match package.json');
}

Related Pages

Implements Principle

Requires Environment

Page Connections

Double-click a node to navigate. Hold to expand connections.
Principle
Implementation
Heuristic
Environment