Gathering detailed insights and metrics for tinydate
Gathering detailed insights and metrics for tinydate
Gathering detailed insights and metrics for tinydate
Gathering detailed insights and metrics for tinydate
A tiny (349B) reusable date formatter. Extremely fast!
npm install tinydate
Typescript
Module System
Min. Node Version
Node Version
NPM Version
99.8
Supply Chain
99.4
Quality
75.4
Maintenance
100
Vulnerability
100
License
JavaScript (100%)
Total Downloads
24,910,549
Last Day
23,779
Last Week
128,920
Last Month
531,021
Last Year
5,599,345
MIT License
1,069 Stars
49 Commits
16 Forks
15 Watchers
1 Branches
2 Contributors
Updated on May 07, 2025
Minified
Minified + Gzipped
Latest Version
1.3.0
Package Id
tinydate@1.3.0
Size
3.37 kB
NPM Version
6.14.5
Node Version
12.18.1
Published on
Jun 29, 2020
Cumulative downloads
Total Downloads
Last Day
50.9%
23,779
Compared to previous day
Last Week
10.4%
128,920
Compared to previous week
Last Month
11.9%
531,021
Compared to previous month
Last Year
-2.6%
5,599,345
Compared to previous year
A tiny (349B) reusable date formatter. Extremely fast!
Inspired by tinytime
, this module returns a "render" function that efficiently re-render your deconstructed template. This allows for incredibly performant results!
However, please notice that this only provides a limited subset of Date methods.
If you need more, tinytime
or date-fns
are great alternatives!
$ npm install --save tinydate
1const tinydate = require('tinydate'); 2const fooDate = new Date('5/1/2017, 4:30:09 PM'); 3 4const stamp = tinydate('Current time: [{HH}:{mm}:{ss}]'); 5 6stamp(fooDate); 7//=> Current time: [16:30:09] 8 9stamp(); 10//=> Current time: [17:09:34]
Returns: Function
Returns a rendering function that will optionally accept a date
value as its only argument.
Type: String
Required: true
The template pattern to be parsed.
Type: Object
Required: false
A custom dictionary of template patterns. You may override existing patterns or declare new ones.
Important: All dictionary items must be a function and must control its own formatting.
For example, when defining your own{ss}
template,tinydate
will not pad its value to two digits.
1const today = new Date('2019-07-04, 5:30:00 PM'); 2 3// Example custom dictionary: 4// - Adds {MMMM} 5// - Overrides {DD} 6const stamp = tinydate('Today is: {MMMM} {DD}, {YYYY}', { 7 MMMM: d => d.toLocaleString('default', { month: 'long' }), 8 DD: d => d.getDate() 9}); 10 11stamp(today); 12//=> 'Today is: July 4, 2019'
Type: Date
Default: new Date()
The date from which to retrieve values. Defaults to current datetime if no value is provided.
{YYYY}
: full year; eg: 2017{YY}
: short year; eg: 17{MM}
: month; eg: 04{DD}
: day; eg: 01{HH}
: hours; eg: 06 (24h){mm}
: minutes; eg: 59{ss}
: seconds; eg: 09{fff}
: milliseconds; eg: 555# Node v10.13.0
tinydate x 160,834,214 ops/sec ±0.21% (96 runs sampled)
tinytime x 44,602,162 ops/sec ±0.34% (97 runs sampled)
time-stamp x 888,153 ops/sec ±1.27% (86 runs sampled)
MIT © Luke Edwards
No vulnerabilities found.
Reason
no dangerous workflow patterns detected
Reason
no binaries found in the repo
Reason
0 existing vulnerabilities detected
Reason
license file detected
Details
Reason
Found 1/29 approved changesets -- score normalized to 0
Reason
dependency not pinned by hash detected -- score normalized to 0
Details
Reason
detected GitHub workflow tokens with excessive permissions
Details
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Score
Last Scanned on 2025-05-05
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