Build & Tooling

dependency

A dependency is someone else's code that your project relies on to work. Almost nothing is built from scratch anymore: you want to parse a date, draw a chart, or talk to a database, so instead of writing that yourself you reach for a library that already does it — and now your project depends on it.

You don't paste that code into your project by hand. Instead you write its name (and which version you'll accept) in a small manifest file, and your package manager reads that list and installs each one for you, along with whatever those need in turn.

It's a wonderful shortcut — you stand on a mountain of work other people already did. The trade-off is that you've taken on their code: when a dependency has a bug, gets an update, or is abandoned, that's now partly your concern too. Lean on dependencies, but know what you're leaning on.

// package.json
"dependencies": {
  "react": "^18.2.0",
  "lodash": "^4.17.21"
}

You list names and acceptable versions; the package manager installs the rest.

A 'devDependency' is one you only need while building or testing (a linter, a test runner) — not something shipped to your users.

Also called
dependencieslibrarypackagethird-party codedep