Packages

date-fns

4.4.0 · 29 May 2026MIT126.2M / weekRepositorynpmAtom feed

Upgrading date-fns From 2.30.0 to 3.0.0

1 release in betweenevery note read

Other targets from 2.30.0Latest4.4.0
  1. 2.30.0yours
  2. 3.0.0target
15
changes to make
0
advisories fixed
6
new
0
fixes

Before you upgrade

Tick each one off as you go
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0
  • Breaking3.0.0

Release by release

  1. 3.0.0

    Migration needed18 Dec 20236 new
    • Breaking

      date-fns is now a dual-package with the support of both ESM and CommonJS. The files exports are now explicitly in the package.json. The ESM files now have .mjs extension.

    • Breaking

      The package now has a flat structure, meaning functions are now named node_modules/date-fns/add.mjs, locales are node_modules/date-fns/locale/enUS.mjs, etc.

    • Breaking

      Now all file content’s exported via named exports instead of export default, which will require change direct imports i.e. const addDays = require(‘date-fns/addDays’) to const { addDays } = require(‘date-fns/addDays’).

    • Breaking

      TypeScript types are now completely rewritten, check out the d.ts files for more information.

A whole project to check? Paste its package.json in the dependency check: every deprecated, outdated or vulnerable dependency, with what to upgrade to. Free, no account.