← All open source projects

Lerna

lerna/lerna

Lerna manages multiple JavaScript and TypeScript packages in one repository.

Forks 2,272
Author lerna
Language TypeScript
License MIT
Synced 2026-06-27

What Lerna is

Lerna is a management system for multi-package JavaScript projects. Lerna helps run tasks, link packages, detect affected changes, and publish multiple packages from one codebase.

When a library is split into many packages, ordinary commands quickly become manual work around versions, dependencies, and publishing. That makes the page useful as more than a short catalog card: it explains where the project helps and which part of the job it takes over.

The lerna/lerna repository appeared on GitHub in 2015. For this kind of project, that history matters because code, examples, documentation, and community habits accumulate over time.

Why it exists

The project appeared as a practical answer to libraries where one repository contains several related npm packages.

The main point of Lerna is not to replace every neighboring tool. It covers a specific part of the work: package, task, and release management inside one connected codebase. The clearer that part is, the easier it is to decide whether the project belongs in a stack.

Lerna is best judged through practice: what data goes in, which actions happen, what result comes out, and who owns support after the first run.

Inside the repository

The repository contains TypeScript Lerna code, CLI commands, affected-package logic, tests, and documentation.

Lerna works over a package structure and helps run commands only where needed, while also publishing related versions.

That structure matters for maintenance. Once a project enters a real system, value comes not only from core features but also from tests, clear configuration, releases, and the ability to track behavior changes.

How people use it

It is used by libraries, design systems, build tools, and teams that keep several npm packages together.

A good start is package inventory, one lockfile, and one check command that can run for affected parts.

A good first scenario for Lerna is a small check on real data or a realistic task. It reveals limits faster than browsing a feature list.

Strengths

Lerna is strong because it gives a clear model for related packages and fits the npm ecosystem.

It stands out because multi-package JavaScript projects became a common shape for large libraries and internal platforms.

Another advantage is a clear entry point. Even a large project can be studied through one scenario: install it, repeat an example, change one setting, and check the result.

Limits

The limitation is that the tool does not replace architectural boundaries between packages.

Teams should agree on versioning rules, package names, dependencies, and publishing order.

For long-term use, decide who updates the project, where configuration is stored, how new versions are checked, and what to do if behavior changes after an update.

Example

Running package tasks

This example shows how Lerna narrows a command to the needed package and related changes.

Language: Bash
npx lerna run test --scope=@acme/ui
npx lerna run build --since=main