GlossaryTools

What is a dependency?

A dependency is a piece of code that another piece of code relies on to function.

In coding, a dependency is a library, framework, or module that your code needs to run properly. For example, if you're building a web application using a JavaScript framework like React, React is a dependency of your application.

Dependencies help you avoid rewriting code and allow you to use pre-built solutions for common tasks. However, managing dependencies is crucial, as they can affect how your application runs and may need to be updated or changed over time.

When you install a package using a tool like npm, you're often adding dependencies to your project. Keeping track of these dependencies ensures your code remains functional and up to date.

Example

import React from 'react'; // React is a dependency here

Want to use Dependency in real work?

WeCode workshops are built around AI coding tools. Pick a tier, or browse more glossary entries to get the lay of the land.