packages

A folder becomes a package when package.json exists That file is the contract between your code and everyone who runs it

Minimal shape

{
  "name": "patch-tool",
  "type": "module",
  "private": true,
  "scripts": {
    "check": "node --check src/main.js"
  }
}

private: true stops an accidental publish Scripts are the public interface of a project

Lockfile

Commit the lockfile It pins the resolved tree so two installations match Deleting it to “fix” a conflict guarantees the next install is a different program

Dependency boundary

  • direct dependencies are code you import
  • dev dependencies are tools that build or test
  • peer dependencies are expected from the consumer

Putting a runtime library in dev dependencies fails at start time in production Putting a test runner in dependencies bloats the install

Audit

Run the package manager audit and read the output Do not auto-fix a major upgrade without reading the changelog

Next

Files in 04 filesystem

Posted