</>PackageGraphPackageGraph

dayjs

npmv1.11.23TypeScript

2KB 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

666 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

PackageWeekly downloadsDependentsLicenseLast release
dayjsthis page48.7M1MIT23 days ago
moment31.5M2MIT1 day ago
redux30.2M5MIT1 day ago
@reduxjs/toolkit26.4M2MIT1 day ago
immer03MIT1 day ago
immutable07MIT1 day ago

Dependencies

Declared by dayjs v1.11.23. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (30)

@babel/cli ^7.0.0-beta.44@babel/core ^7.0.0-beta.44@babel/node ^7.0.0-beta.44@babel/preset-env ^7.0.0-beta.44@semantic-release/github ^11.0.4babel-core ^7.0.0-bridge.0babel-jest ^22.4.3babel-plugin-external-helpers ^6.22.0cross-env ^5.1.6eslint ^4.19.1eslint-config-airbnb-base ^12.1.0eslint-plugin-import ^2.10.0eslint-plugin-jest ^21.15.0gzip-size-cli ^2.1.0jasmine-core ^2.99.1jest ^22.4.3karma ^2.0.2karma-jasmine ^1.1.2karma-sauce-launcher ^1.1.0mockdate ^2.0.2moment 2.29.2moment-timezone 0.5.31ncp ^2.0.0pre-commit ^1.2.2prettier ^1.16.1rollup ^2.45.1rollup-plugin-babel ^4.4.0rollup-plugin-terser ^7.0.2size-limit ^0.18.0typescript ^2.8.3

Used by

Popular packages that depend on dayjs.

Relationship graph

Dependencies (left) and dependents (right) of dayjs.

logkittydayjs
dayjs dependencies dependents

Frequently installed together

Release history

10 releases in the last two years, typically about 47 days apart.

Recent versions of dayjs
VersionPublishedSizeLicense
1.11.23latest23 days ago666 KBMIT
1.11.2224 days ago665 KBMIT
1.11.213 months ago664 KBMIT
1.11.206 months ago664 KBMIT
1.11.1910 months ago663 KBMIT
1.11.181 year ago657 KBMIT
1.11.171 year ago657 KBMIT
1.11.161 year ago659 KBMIT
1.11.151 year ago656 KBMIT
1.11.141 year ago655 KBMIT
1.11.132 years ago655 KBMIT
1.11.122 years ago653 KBMIT
1.11.112 years ago650 KBMIT
1.11.103 years ago648 KBMIT
1.11.93 years ago641 KBMIT

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

Keywords

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.