Skip to content
BENIBIX Learn

Dependency

Development🛠️ Editors & ToolsPackages

Also known as Software Dependency, Package Dependency

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

Think of it like

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

Example

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

Why it matters

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

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 code

json
{
  "dependencies": {
    "lodash": "^4.18.1"
  }
}
The project file lists each package it needs and which version.

Common mistake

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

Key takeaways

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

Learn it properly