Favicon of Turborepo

Turborepo

Turborepo is a Rust-based build system that caches and parallelizes tasks across JavaScript and TypeScript monorepos to speed up builds, tests, and lints.

Open Source Alternative to:
Turborepo website screenshot
Turborepo GitHub repository preview

Turborepo is a build system built for JavaScript and TypeScript codebases, especially monorepos with multiple packages and apps. It's aimed at teams and individual developers who run repeated build, test, lint, or type-check tasks across many workspaces and want those tasks to run faster by skipping redundant work.

At its core, Turborepo understands the dependency graph between your packages and schedules tasks accordingly. It caches task output (local and remote) so that if the inputs haven't changed, the task doesn't re-run at all, it just replays the cached result. This matters most once a repo grows past a handful of packages, where a full build or test across every workspace starts taking minutes instead of seconds.

Key features

  • Task caching: Turborepo hashes task inputs and skips execution when nothing has changed, replaying previous output instead.
  • Remote caching: Cache artifacts can be shared across machines and CI runs so a teammate (or a CI job) doesn't rebuild what someone else already built.
  • Parallel execution: Independent tasks across packages run concurrently, respecting the dependency graph so downstream tasks wait on their prerequisites.
  • Monorepo-aware task graph: Turborepo reads your existing workspace configuration (npm, yarn, or pnpm workspaces) and builds a task pipeline from it, so you don't redefine your package structure.
  • Rust-based core: The task scheduler and caching engine are written in Rust for performance, while the developer-facing config stays in JSON/TypeScript.
  • Incremental adoption: You can add Turborepo to an existing monorepo without restructuring packages or changing your package manager.

Ideal use cases

Turborepo fits teams running a monorepo with multiple apps and shared packages (a Next.js app plus a design-system package plus a shared utils package, for example) where build, lint, and test scripts are duplicated across CI runs and local dev. It's also useful for CI pipelines that want to avoid rebuilding unchanged packages on every push, cutting CI time significantly once caching is warmed up.

It's a good fit if you're already using npm, yarn, or pnpm workspaces and want a task runner layered on top, rather than a full replacement for your package manager or bundler. It is not a bundler, a test runner, or a package manager itself. It orchestrates the scripts you already have.

It's a weaker fit for single-package repositories with no shared dependency graph to exploit, since there's little redundant work to cache or parallelize. Very small teams with fast, simple builds may not see enough benefit to justify the added configuration.

Installation

Turborepo ships as an npm package (turbo) and works alongside your existing package manager in a JavaScript or TypeScript workspace.

Install it as a dev dependency in your workspace root:

npm install turbo --save-dev
# or
yarn add turbo --dev
# or
pnpm add turbo --save-dev

You can also run it without a local install using npx:

npx turbo build

From there, define your task pipeline in a turbo.json (or the turbo key in package.json) at the root of your monorepo, describing tasks like build, lint, and test and their dependencies. Full setup instructions, configuration reference, and remote caching setup are maintained on the official site at https://turborepo.dev.

Frequently asked questions

Share:

Stars
31.2K
Forks
2.5K
Last commit
14 hours ago
Repository age
5 years
License
MIT
Self-hosted
No
Activity score
84/100
View Repository
Ad
Favicon

 

  
 

Similar to Turborepo

Favicon

 

  
 
Favicon

 

  
 
Favicon