# Dependency

> Code someone else wrote that your project needs in order to work.

**Field:** Software Development  
**Category:** Editors & Tools  
**Also known as:** Software Dependency, Package Dependency

## Think of it like

Think of it like the flour in a cake. The cake cannot be made until you have it.

## Definition

A dependency is outside code your project needs in order to work. It is usually a library or framework someone else wrote. Your project keeps a list of them, often with the version of each. Each one can need others too, so one can pull in dozens more. If one breaks or has a hole, each project that uses it is at risk.

## Example

Jack adds one charting library to his app. It brings 12 more packages with it, and now his project has 13 dependencies.

## Example code

```json
{
  "dependencies": {
    "lodash": "^4.18.1"
  }
}
```

The project file lists each package it needs and which version.

## Why it matters

Most of the code in a modern app is dependencies. Keeping them up to date keeps the app safe.

## Common mistake

Adding packages without checking who looks after them. A package no one keeps can break or let in an attack.

## Three principles

- **Outside code.** Written and kept by someone else.
- **Chains of them.** One package can pull in many more.
- **Keep them fresh.** Old versions can hold known holes.

## Related terms

- [Software Library](https://learn.benibix.com/term/development/library)
- [Package Manager](https://learn.benibix.com/term/development/package-manager)
- [Software Framework](https://learn.benibix.com/term/development/framework)
- [npm](https://learn.benibix.com/term/development/npm)
- [Lockfile](https://learn.benibix.com/term/development/lockfile)
- [Software Package](https://learn.benibix.com/term/development/software-package)
- [Dependency Hell](https://learn.benibix.com/term/development/dependency-hell)

## Taught in

- [Libraries, Frameworks and SDKs](https://learn.benibix.com/learn/development-tools/libraries-frameworks-and-sdks): Coding Tools, 7/13

---

Source: https://learn.benibix.com/term/development/dependency
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-17
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
