NestJS vs Express: source lines of code compared

The NestJS vs Express comparison on OctoCounts shows side-by-side source line counts for nestjs/nest and expressjs/express, 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 expressjs/express 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, nestjs/nest contains 168,477 total lines (136,600 code) across 2,284 files, while expressjs/express contains 9,408 total lines (2,619 code) across 70 files as of 2026-11-03. nestjs/nest has about 52x the counted code lines of expressjs/express 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/nestexpressjs/express
Files2,28470
Total lines168,4779,408
Code lines136,6002,619
Comment lines17,2805,227
Blank lines14,5971,562
Languages counted147

Top languages in nestjs/nest: TypeScript (76.0% of code), JSON (23.4% of code), JavaScript (0.2% of code). Top languages in expressjs/express: JavaScript (90.5% of code), JSON (3.8% of code), Handlebars (2.7% of code). JSON, JavaScript appear in both top language lists; TypeScript, YAML, GraphQL appear only in nestjs/nest's top languages; Handlebars, CSS, HTML appear only in expressjs/express's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. nestjs/nest was counted at ref master (commit 6e83cc83c99c) on 2026-11-05; expressjs/express was counted at ref a419aa7350389a275ab45fde2e849ed1f02449ef (commit a419aa735038) on 2026-11-03. 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. expressjs/express: 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 framework repository: its core packages, platform adapters, sample projects, and documentation — a TypeScript framework that runs on top of an underlying HTTP server library (Express by default). expressjs/express is the Express framework itself, a comparatively minimal JavaScript web framework for Node.js. The two repositories are related layers rather than substitutes, and their measurements were taken on the dates in the methodology line.

NestJS provides a TypeScript-oriented application framework over HTTP adapters, while Express supplies a Node.js web-server and middleware API. Their source trees therefore represent different layers, even when used in the same application.

NestJS ships sample applications and multiple platform packages inside its repository, so part of its count exists to demonstrate and adapt the framework rather than to run as the framework core.

NestJS normally runs on top of Express (or an alternative adapter), so the two counts overlap in the stack rather than compete; neither number says anything about which suits a given application.

Sources: nestjs/nest repository · expressjs/express 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 expressjs/express?

As of 2026-11-05, nestjs/nest contains 168,477 total lines (136,600 code) across 2,284 files, while expressjs/express contains 9,408 total lines (2,619 code) across 70 files as of 2026-11-03. nestjs/nest has about 52x the counted code lines of expressjs/express 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, expressjs/express, 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 6e83cc83c99c) on 2026-11-05; expressjs/express was counted at ref a419aa7350389a275ab45fde2e849ed1f02449ef (commit a419aa735038) on 2026-11-03. 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.