Lerna is an open-source tool for managing JavaScript and TypeScript monorepos, specializing in dependency management, versioning, and package publishing across multiple packages within a single repository. It streamlines the process of maintaining libraries and applications that share code, providing automated workflows for bootstrapping dependencies, running scripts across packages, and publishing updated packages to npm. Lerna was one of the first tools to popularize the monorepo approach in the JavaScript ecosystem.
Key features include two versioning modes: fixed mode where all packages share the same version number, and independent mode where each package maintains its own version. Lerna handles dependency hoisting to reduce duplication, parallelized script execution across packages, and intelligent change detection that only versions and publishes packages that have actually been modified. The tool integrates with npm and Yarn workspaces for efficient dependency resolution and can be combined with build caching tools for additional performance.
Lerna remains the top choice for teams focused on publishing multiple npm packages from a single repository, offering the most mature and battle-tested publishing workflow in the JavaScript ecosystem. It is widely used by major open-source projects including Babel, Jest, and React, demonstrating its reliability for large-scale library development. While newer tools like Turborepo and Nx provide stronger build orchestration capabilities, Lerna excels specifically at the versioning and publishing workflow that library authors need most.