dayjs
npmv1.11.23TypeScript2KB immutable date time library alternative to Moment.js with the same modern API
Safe to adopt
Yes — dayjs scores well across adoption, maintenance, weight, supply chain, and licensing. 48.7M downloads per week and 1 known dependents. Last published 23 days ago. 10 releases in the last 2 years.
- AAdoption: grade A, Excellent.
48.7M downloads per week and 1 known dependents.
- AMaintenance: grade A, Excellent.
Last published 23 days ago. 10 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 666 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding dayjs to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- No constraint declared
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the dayjs README.
dayjs().startOf('month').add(1, 'day').set('year', 2018).format('YYYY-MM-DD HH:mm:ss');dayjs vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| dayjsthis page | 48.7M | 1 | MIT | 23 days ago |
| moment | 31.5M | 2 | MIT | 1 day ago |
| redux | 30.2M | 5 | MIT | 1 day ago |
| @reduxjs/toolkit | 26.4M | 2 | MIT | 1 day ago |
| immer | 0 | 3 | MIT | 1 day ago |
| immutable | 0 | 7 | MIT | 1 day ago |
Dependencies
Declared by dayjs v1.11.23. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (30)
Used by
Popular packages that depend on dayjs.
Relationship graph
Dependencies (left) and dependents (right) of dayjs.
Frequently installed together
An AST-based pattern checker for JavaScript.
Delightful JavaScript Testing.
TypeScript definitions for node
TypeScript definitions for yargs
yargs the modern, pirate-themed, successor to optimist.
Jest plugin to use babel for transformation.
Babel preset for TypeScript.
A tiny library with builders to help making logs/CLI pretty with a nice DX.
Release history
10 releases in the last two years, typically about 47 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.11.23latest | 23 days ago | 666 KB | MIT |
| 1.11.22 | 24 days ago | 665 KB | MIT |
| 1.11.21 | 3 months ago | 664 KB | MIT |
| 1.11.20 | 6 months ago | 664 KB | MIT |
| 1.11.19 | 10 months ago | 663 KB | MIT |
| 1.11.18 | 1 year ago | 657 KB | MIT |
| 1.11.17 | 1 year ago | 657 KB | MIT |
| 1.11.16 | 1 year ago | 659 KB | MIT |
| 1.11.15 | 1 year ago | 656 KB | MIT |
| 1.11.14 | 1 year ago | 655 KB | MIT |
| 1.11.13 | 2 years ago | 655 KB | MIT |
| 1.11.12 | 2 years ago | 653 KB | MIT |
| 1.11.11 | 2 years ago | 650 KB | MIT |
| 1.11.10 | 3 years ago | 648 KB | MIT |
| 1.11.9 | 3 years ago | 641 KB | MIT |
Overview
dayjs is an npm package that 2KB immutable date time library alternative to Moment.js with the same modern API. It is extremely widely used, with about 48.7M downloads per week and 1 known dependents in the graph. The latest version is 1.11.23, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need 2KB immutable date time library alternative to Moment.js with the same modern API and value a battle-tested, widely-adopted solution.
When not to use it
Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.
Pros
- Large, well-established user base (48.7M weekly downloads).
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Large dependency tree (30 direct dependencies) increases install size and audit surface.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Frequently asked questions
Should I use dayjs?
Yes — dayjs scores well across adoption, maintenance, weight, supply chain, and licensing. 48.7M downloads per week and 1 known dependents. Last published 23 days ago. 10 releases in the last 2 years.
How do I install dayjs?
Run `npm install dayjs` to add dayjs to your npm project.
What license is dayjs released under?
dayjs is distributed under the MIT license.
How popular is dayjs?
dayjs has approximately 48,716,594 downloads per week and 1 known dependent packages.
Is dayjs still maintained?
The most recent release of dayjs (v1.11.23) was published 23 days ago.
Does dayjs run install scripts?
No. dayjs does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.