Moment.js vs Day.js: source lines of code compared

The Moment.js vs Day.js comparison on OctoCounts shows side-by-side source line counts for moment/moment and iamkun/dayjs, 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 moment/moment and iamkun/dayjs 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-08, moment/moment contains 83,845 total lines (74,484 code) across 454 files, while iamkun/dayjs contains 54,032 total lines (51,275 code) across 232 files as of 2026-11-06. moment/moment has about 1.5x the counted code lines of iamkun/dayjs 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.

Metricmoment/momentiamkun/dayjs
Files454232
Total lines83,84554,032
Code lines74,48451,275
Comment lines3,8691,306
Blank lines5,4921,451
Languages counted54

Top languages in moment/moment: JavaScript (93.2% of code), TypeScript (3.3% of code), YAML (3.0% of code). Top languages in iamkun/dayjs: JSON (83.0% of code), JavaScript (15.9% of code), TypeScript (1.1% of code). JavaScript, TypeScript, JSON, Markdown appear in both top language lists; YAML appears only in moment/moment's top languages.

Methodology: both counts come from cached OctoCounts reports generated with tokei. moment/moment was counted at ref develop (commit c2a703a4d84a) on 2026-11-08; iamkun/dayjs was counted at ref dev (commit d3e43be0489f) on 2026-11-06. 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. moment/moment: 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. iamkun/dayjs: 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: moment/moment is the Moment.js repository — the date library, its large bundled locale data, plugins, tests, and documentation. iamkun/dayjs is the Day.js repository — the core date library with its plugin set, locales, and tests. Both repositories are date-library source trees, but Moment's tree includes a much larger share of shipped locale and formatting data, as the per-language tables of the two reports show.

A large part of Moment's counted tree is locale data and the files that ship with the published package rather than core parsing logic — visible in its per-language table — so its total measures a library-plus-its-data, not just code.

Day.js's counted tree is organized around a minimal core plus optional plugins that users enable individually, so its total measures a deliberately split codebase; the two totals therefore describe different packaging strategies for the same category of library.

Repository size here mostly reflects how much each project ships with — locales, plugins, and packaging — not runtime speed or API quality. Read the totals as a measure of shipped source, not of which date library suits a project.

Sources: moment/moment repository (with bundled locales) · iamkun/dayjs 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, moment/moment or iamkun/dayjs?

As of 2026-11-08, moment/moment contains 83,845 total lines (74,484 code) across 454 files, while iamkun/dayjs contains 54,032 total lines (51,275 code) across 232 files as of 2026-11-06. moment/moment has about 1.5x the counted code lines of iamkun/dayjs 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 moment/moment, iamkun/dayjs, or any repository.

How is this comparison calculated?

Methodology: both counts come from cached OctoCounts reports generated with tokei. moment/moment was counted at ref develop (commit c2a703a4d84a) on 2026-11-08; iamkun/dayjs was counted at ref dev (commit d3e43be0489f) on 2026-11-06. 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.