library

A package of reusable code that other programs include and call, rather than a program you run on its own.

In more detail

A library provides functions and types that your code calls; it does not run on its own. Libraries come with a language's standard library or are installed from a package registry, usually at a version recorded by a dependency manager. Sharing code through a versioned library is safer than copying it between projects.

Examples

In the browser: Libraries add download size and trust in a third party. Native browser features such as View Transitions and EventTarget can replace some of them.
Your own library: a package folder of modules you import from your scripts.

Related terms

Taught in

References