Installations
npm install date-fns
Score
99.2
Supply Chain
90.7
Quality
84.8
Maintenance
100
Vulnerability
100
License
Developer
Developer Guide
Module System
ESM, UMD
Min. Node Version
Typescript Support
Yes
Node Version
20.14.0
NPM Version
10.7.0
Statistics
34,937 Stars
2,226 Commits
1,796 Forks
207 Watching
23 Branches
400 Contributors
Updated on 28 Nov 2024
Bundle Size
77.21 kB
Minified
17.48 kB
Minified + Gzipped
Languages
TypeScript (99.11%)
Shell (0.49%)
JavaScript (0.41%)
Total Downloads
Cumulative downloads
Total Downloads
3,630,889,871
Last day
-8.6%
4,420,004
Compared to previous day
Last week
1.6%
25,410,644
Compared to previous week
Last month
10.8%
105,550,102
Compared to previous month
Last year
23.1%
1,026,318,133
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
39
🔥️ NEW: date-fns v4.0 with first-class time zone support is out!
date-fns provides the most comprehensive, yet simple and consistent toolset for manipulating JavaScript dates in a browser & Node.js
👉 Blog
It's like Lodash for dates
- It has 200+ functions for all occasions.
- Modular: Pick what you need. Works with webpack, Browserify, or Rollup and also supports tree-shaking.
- Native dates: Uses existing native type. It doesn't extend core objects for safety's sake.
- Immutable & Pure: Built using pure functions and always returns a new date instance.
- TypeScript: The library is 100% TypeScript with brand-new handcrafted types.
- I18n: Dozens of locales. Include only what you need.
- and many more benefits
1import { compareAsc, format } from "date-fns"; 2 3format(new Date(2014, 1, 11), "yyyy-MM-dd"); 4//=> '2014-02-11' 5 6const dates = [ 7 new Date(1995, 6, 2), 8 new Date(1987, 1, 11), 9 new Date(1989, 6, 10), 10]; 11dates.sort(compareAsc); 12//=> [ 13// Wed Feb 11 1987 00:00:00, 14// Mon Jul 10 1989 00:00:00, 15// Sun Jul 02 1995 00:00:00 16// ]
The library is available as an npm package. To install the package run:
1npm install date-fns --save
Docs
See date-fns.org for more details, API, and other docs.
License
No vulnerabilities found.
Reason
30 commit(s) and 2 issue activity found in the last 90 days -- score normalized to 10
Reason
security policy file detected
Details
- Info: security policy file detected: SECURITY.md:1
- Info: Found linked content: SECURITY.md:1
- Info: Found disclosure, vulnerability, and/or timelines in security policy: SECURITY.md:1
- Info: Found text in security policy: SECURITY.md:1
Reason
no dangerous workflow patterns detected
Reason
license file detected
Details
- Info: project has a license file: LICENSE.md:0
- Info: FSF or OSI recognized license: MIT License: LICENSE.md:0
Reason
no binaries found in the repo
Reason
Found 0/21 approved changesets -- score normalized to 0
Reason
detected GitHub workflow tokens with excessive permissions
Details
- Warn: no topLevel permission defined: .github/workflows/attw_tests.yaml:1
- Warn: no topLevel permission defined: .github/workflows/browser_tests.yaml:1
- Warn: no topLevel permission defined: .github/workflows/code_quality.yaml:1
- Warn: no topLevel permission defined: .github/workflows/coverage.yaml:1
- Warn: no topLevel permission defined: .github/workflows/node_tests.yaml:1
- Warn: no topLevel permission defined: .github/workflows/smoke_tests.yaml:1
- Warn: no topLevel permission defined: .github/workflows/tz_tests.yaml:1
- Info: no jobLevel write permissions found
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/attw_tests.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/attw_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/attw_tests.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/attw_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/browser_tests.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/browser_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/browser_tests.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/browser_tests.yaml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/browser_tests.yaml:19: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/browser_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code_quality.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/code_quality.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/code_quality.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/code_quality.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yaml:13: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/coverage.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/coverage.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/coverage.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node_tests.yaml:14: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/node_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/node_tests.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/node_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke_tests.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/smoke_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/smoke_tests.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/smoke_tests.yaml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/smoke_tests.yaml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/smoke_tests.yaml/main?enable=pin
- Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/tz_tests.yaml:10: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/tz_tests.yaml/main?enable=pin
- Warn: third-party GitHubAction not pinned by hash: .github/workflows/tz_tests.yaml:11: update your workflow using https://app.stepsecurity.io/secureworkflow/date-fns/date-fns/tz_tests.yaml/main?enable=pin
- Warn: npmCommand not pinned by hash: scripts/test/smoke.sh:20
- Warn: npmCommand not pinned by hash: .github/workflows/attw_tests.yaml:16
- Warn: npmCommand not pinned by hash: .github/workflows/browser_tests.yaml:16
- Warn: npmCommand not pinned by hash: .github/workflows/code_quality.yaml:16
- Warn: npmCommand not pinned by hash: .github/workflows/coverage.yaml:18
- Warn: npmCommand not pinned by hash: .github/workflows/node_tests.yaml:20
- Warn: npmCommand not pinned by hash: .github/workflows/smoke_tests.yaml:17
- Info: 0 out of 13 GitHub-owned GitHubAction dependencies pinned
- Info: 0 out of 3 third-party GitHubAction dependencies pinned
- Info: 0 out of 7 npmCommand dependencies pinned
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 10 are checked with a SAST tool
Reason
24 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-3h5v-q93c-6h6q
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-c24v-8rfc-w8vw
- Warn: Project is vulnerable to: GHSA-8jhw-289h-jh2g
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986 / GHSA-64vr-g452-qvp3
- Warn: Project is vulnerable to: GHSA-9cwx-2883-4wfx
- Warn: Project is vulnerable to: GHSA-7q7g-4xm8-89cq
- Warn: Project is vulnerable to: GHSA-3wf4-68gx-mph8
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-8cf7-32gw-wr33
- Warn: Project is vulnerable to: GHSA-hjrf-2m68-5959
- Warn: Project is vulnerable to: GHSA-qwph-4952-7xr6
- Warn: Project is vulnerable to: GHSA-9wv6-86v2-598j
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-3f95-r44v-8mrg
- Warn: Project is vulnerable to: GHSA-28xr-mwxg-3qc8
- Warn: Project is vulnerable to: GHSA-9p95-fxvg-qgq2
- Warn: Project is vulnerable to: GHSA-9w5j-4mwv-2wj8
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
Score
4.5
/10
Last Scanned on 2024-11-25
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More