pnpm vs Yarn: source lines of code compared

The pnpm vs Yarn comparison on OctoCounts shows side-by-side source line counts for pnpm/pnpm and yarnpkg/berry, counted under the rules and on the dates stated below: files, total lines, code lines, comment lines, blank lines, and per-language totals, pinned to the exact commits listed below.

This page compares the source lines of code (SLOC) of pnpm/pnpm and yarnpkg/berry using cached OctoCounts reports. Code size is not code quality: a larger count only means more source material, not a better or worse project.

As of 2026-11-05, pnpm/pnpm contains 916,715 total lines (789,092 code) across 5,936 files, while yarnpkg/berry contains 122,931 total lines (96,091 code) across 1,120 files as of 2026-10-27. These reports use different engines or counting rules; no like-for-like size ratio is stated. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricpnpm/pnpmyarnpkg/berry
Files5,9361,120
Total lines916,715122,931
Code lines789,09296,091
Comment lines45,5858,571
Blank lines82,03818,269
Languages counted1616

Top languages in pnpm/pnpm: Rust (72.1% of code), TypeScript (17.6% of code), YAML (4.8% of code). Top languages in yarnpkg/berry: TypeScript (66.0% of code), JavaScript (23.9% of code), JSON (5.7% of code). TypeScript, JSON, JavaScript appear in both top language lists; Rust, YAML appear only in pnpm/pnpm's top languages; TSX, CSS appear only in yarnpkg/berry's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. pnpm/pnpm was counted at ref main (commit 5038f0a30751) on 2026-11-05; yarnpkg/berry was counted at ref master (commit 8f638c0806ec) on 2026-10-27. See the counting methodology for ignored directories and analysis options.

These reports use different engines or counting rules; do not interpret their ratio as a like-for-like comparison. pnpm/pnpm: tokei-15.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed. yarnpkg/berry: tokei-14.0.0, policy directories-v1; docs excluded, tests excluded, generated excluded. Excluded directory names: .cache, .generated, .git, .next, __tests__, build, dist, doc, docs, documentation, fixtures, gen, generated, node_modules, target, test, tests, vendor. Ignored languages: none. Repository declarations: off. Exclusions are rule-based; they do not prove that every test, document or generated file was removed.

About this comparison

Background observations recorded on 2026-09-16; language descriptions here are historical context, not claims about the current filtered shares. Use this page's measured language breakdown for current counts. Repository layout before counting filters: pnpm/pnpm is the pnpm package manager repository: its core, CLI, and plugin-style subpackages, all maintained as one TypeScript tree. yarnpkg/berry is the Yarn 2+ codebase — the modern Yarn version maintained as a monorepo of its core and published subpackages. Both repositories are therefore package-manager source trees of the same generation, counted on the dates in the methodology line above.

Both package managers maintain installation logic and supporting tooling. Sharing an implementation language does not establish comparable counting rules; compare the declared policies and repository scope alongside the totals.

A smaller source tree does not install dependencies faster or use less disk space: install performance and store layout depend on the released tool's design and on the project being installed, not on repository line counts.

Sources: pnpm/pnpm repository · yarnpkg/berry repository (Yarn 2+ monorepo). Statements verified 2026-09-16.

Evidence and next steps:

Saved reports remain subject to cache cleanup and replacement. Export their JSON for durable citation; live report URLs can change.

Note: code size is not code quality. OctoCounts only reports reproducible line counts and makes no claim that either project is better.

Compare FAQ

Which has more lines of code, pnpm/pnpm or yarnpkg/berry?

As of 2026-11-05, pnpm/pnpm contains 916,715 total lines (789,092 code) across 5,936 files, while yarnpkg/berry contains 122,931 total lines (96,091 code) across 1,120 files as of 2026-10-27. These reports use different engines or counting rules; no like-for-like size ratio is stated. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Does more source lines of code mean more complexity?

Not necessarily. SLOC measures size, not complexity, quality, or maintainability. A larger codebase can mean more features, more generated or vendored code, more verbose language idioms, or more tests — none of which imply the code is harder to work with. Use SLOC to gauge the scale of what you'd be reading or maintaining, not as a quality signal for pnpm/pnpm, yarnpkg/berry, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. pnpm/pnpm was counted at ref main (commit 5038f0a30751) on 2026-11-05; yarnpkg/berry was counted at ref master (commit 8f638c0806ec) on 2026-10-27. See the counting methodology for ignored directories and analysis options.

Can I compare a different branch, tag, or commit?

Yes. This page shows the default branch for each repository. Use the interactive comparison tool to pick any public GitHub repository, branch, tag, or commit SHA for both sides and get a fresh side-by-side report.