Essential Libraries Best Practices
Rules that keep npm dependencies maintainable, secure, and consistent across Node.js services.
Search across all documentation pages
Rules that keep npm dependencies maintainable, secure, and consistent across Node.js services.
docs/adr/.fetch, node:test, node:crypto before npm equivalents.package-lock.json or pnpm/yarn equivalent.npm ci in CI, never npm install. Reproducible graphs on every pipeline run.24.18.0 aligned with .nvmrc and Docker base image.@acme/shared-* peer deps match service deps.npm audit --audit-level=high on every PR. Block merge until fixed or excepted.postinstall additions are high risk..env committed. Use platform inject and secrets managers.pino-pretty in prod images; redact auth headers.new Date("local string") without offset.cache: vs BullMQ internal prefix.depcheck quarterly. Dead packages still audit-fail.Defaults are strong recommendations. Deviations need ADR, not hallway agreement. Exceptions expire when the ADR is revisited.
When the team already standardized on axios interceptors across many services. Do not introduce both in one repo without migration plan.
Yes for cross-service contracts (@acme/contracts). Services import shared schemas; do not fork validation per API.
Critical CVE with no patch, compromised package version, or malicious install script. Hotfix branch, lockfile bump, redeploy all affected services within SLA.
Stack versions: This page was written for Node.js 24.18.0 (Active LTS), npm 10+, TypeScript 5.6+, Express 5, Fastify 5, and NestJS 11.
Reviewed by Chris St. John·Last updated Jul 19, 2026