NestJS vs Fastify: source lines of code compared

The NestJS vs Fastify comparison on OctoCounts shows side-by-side source line counts for nestjs/nest and fastify/fastify, 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 nestjs/nest and fastify/fastify 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-16, nestjs/nest contains 185,458 total lines (149,108 code) across 2,333 files, while fastify/fastify contains 15,015 total lines (11,135 code) across 80 files as of 2026-11-15. nestjs/nest has about 13x the counted code lines of fastify/fastify under the same engine and counting rules. Code size is not code quality: a larger count only means more source material, not a better or worse project.

Metricnestjs/nestfastify/fastify
Files2,33380
Total lines185,45815,015
Code lines149,10811,135
Comment lines20,1892,298
Blank lines16,1611,582
Languages counted145

Top languages in nestjs/nest: TypeScript (78.0% of code), JSON (21.4% of code), JavaScript (0.1% of code). Top languages in fastify/fastify: JavaScript (74.8% of code), TypeScript (22.9% of code), JSON (2.1% of code). TypeScript, JSON, JavaScript appear in both top language lists; YAML, GraphQL appear only in nestjs/nest's top languages; Shell, Markdown appear only in fastify/fastify's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. nestjs/nest was counted at ref master (commit 454123b9283a) on 2026-11-16; fastify/fastify was counted at ref main (commit 467972380963) on 2026-11-15. See the counting methodology for ignored directories and analysis options.

Both reports use the same engine and effective counting rules. Repository declarations, when enabled, are specific to each repository. nestjs/nest: 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. fastify/fastify: 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.

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: nestjs/nest is the NestJS monorepo: the framework packages, its tooling, and sample material, written predominantly in TypeScript. fastify/fastify is the Fastify core repository — the HTTP framework, its plugins within the core repo, and tests — written predominantly in JavaScript. The two sit at different layers: NestJS is an architecture framework that can delegate HTTP serving to a Node.js HTTP framework such as Fastify or Express.

The per-language tables show the implementation-language split plainly: NestJS is a TypeScript codebase, while Fastify core remains largely JavaScript — a reflection of each project's chosen source language rather than a difference in capability.

NestJS's count includes framework abstractions over HTTP, routing, and dependency injection, whereas Fastify's count is the HTTP framework layer those abstractions build on, so the two totals describe adjacent parts of a stack rather than rivals at one layer.

Because NestJS can run on top of Fastify, the two repositories are not competitors in the count: reading the totals as framework-vs-framework size misses that one can contain the other at runtime.

Sources: nestjs/nest repository (framework monorepo) · fastify/fastify repository. 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, nestjs/nest or fastify/fastify?

As of 2026-11-16, nestjs/nest contains 185,458 total lines (149,108 code) across 2,333 files, while fastify/fastify contains 15,015 total lines (11,135 code) across 80 files as of 2026-11-15. nestjs/nest has about 13x the counted code lines of fastify/fastify under the same engine and counting rules. 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 nestjs/nest, fastify/fastify, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. nestjs/nest was counted at ref master (commit 454123b9283a) on 2026-11-16; fastify/fastify was counted at ref main (commit 467972380963) on 2026-11-15. 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.