date-fns npm Trends
Download trends, growth, and how date-fns compares to dayjs and luxon
Weekly Downloads — Last 6 Months
Weekly
34.9M
Monthly
189.4M
Growth
+17%
Bundle (gzip)
17.1 kB
dayjs
2KB immutable date time library alternative to Moment.js with the same modern API
Weekly
26.9M
Monthly
148.5M
Growth
+19%
Bundle (gzip)
3.0 kB
Package Breakdown
Functional, tree-shakeable date utilities with excellent TypeScript support
✓ Best For
TypeScript projects, applications needing many date operations, and teams who prefer functional programming patterns
✗ Weakness
More verbose than Day.js for simple operations, no timezone support without date-fns-tz addon
2kB Moment-compatible date library with a chainable API
✓ Best For
Bundle-size-critical applications, teams migrating from Moment.js, and simpler date formatting needs
✗ Weakness
Plugin system required for advanced features, less comprehensive TypeScript types than date-fns
Moment.js successor with first-class timezone and internationalization support
✓ Best For
Applications with complex timezone requirements, internationalization-heavy projects, and interval/duration calculations
✗ Weakness
Larger bundle than Day.js, not tree-shakeable, lower community adoption than date-fns
Should You Use date-fns?
date-fns is the right choice for most TypeScript projects that need more than basic date formatting. The type safety, tree-shakeability, and comprehensive function library make it the most production-hardened functional date library available.
If you need something lightweight and your use case is primarily formatting and simple date arithmetic — Day.js at 2kB is hard to argue with. If you have complex timezone requirements and internationalization needs — Luxon is purpose-built for that.
For the majority of applications — React dashboards, scheduling features, date pickers, reporting — date-fns hits the sweet spot of capability, type safety, and bundle efficiency.
Recommended: date-fns
Best TypeScript support, fully tree-shakeable, and the most comprehensive functional date API available.
Which to Use For Each Use Case
| Use Case | Winner |
|---|---|
| TypeScript project | date-fns |
| Migrating from Moment.js | dayjs |
| Complex timezone handling | luxon |
| Minimal bundle size | dayjs |
| Date picker component | date-fns |
FAQ
Does date-fns support timezones?+
Why are date-fns downloads so high?+
Is date-fns v3 a breaking change from v2?+
Will the Temporal API replace date-fns?+
Related Comparisons
date-fns is one of the most downloaded JavaScript packages on npm — consistently ranking among the top utility libraries across the entire registry. Its approach is deceptively simple: instead of a date object with methods, every operation is a pure function that takes a date and returns a value. No mutation, full tree-shaking, and TypeScript types that are genuinely excellent.
Understanding date-fns download trends matters because it sits at an interesting inflection point: Moment.js is declining (sending downloads somewhere), the native Temporal API is on the horizon, and Day.js offers a lighter alternative. Where date-fns fits in that landscape is the question this page addresses.
Why date-fns Downloads Are So High
date-fns benefits from a compounding effect: it's the recommended alternative when developers migrate away from Moment.js, it's the default in many TypeScript project setups due to its type quality, and it's included as a dependency by popular libraries (date-pickers, calendar components, scheduling tools) — meaning its download count includes transitive installs from projects that never explicitly chose it.
The functional API — format(date, 'MM/dd/yyyy') rather than moment(date).format('MM/DD/YYYY') — aligns naturally with how modern JavaScript is written. Tree-shaking means a project using only format and addDays ships only those two functions, not the entire library.
Compared to Day.js, date-fns is larger when you use many functions but smaller when you use few (due to tree-shaking). Compared to Luxon (the other Moment.js successor, built by one of Moment's authors), date-fns has significantly more downloads and broader community adoption.
Compare Any Packages
Search any npm package and build your own custom comparison.
Open npm Trends Tool