
Research
/Security News
Contagious Interview Campaign Escalates With 67 Malicious npm Packages and New Malware Loader
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
@bitty/format-date
Advanced tools
A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
@bitty/format-date
@bitty/format-date
is a small library (around 400 B when gziped & minified) to format JavaScript Date
object using same tokens as moment.
📦 Distributions in ESM, CommonJS, UMD and UMD minified formats.
⚡ Lightweight:
🔋 Bateries included:
🏷 Safe:
This library is published in the NPM registry and can be installed using any compatible package manager.
npm install @bitty/format-date --save
# For Yarn, use the command below.
yarn add @bitty/format-date
This module has a UMD bundle available through JSDelivr and Unpkg CDNs.
<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/@bitty/format-date"></script>
<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/@bitty/format-date"></script>
<script>
// UMD module is exposed through the "isNullish" global function.
console.log(formatDate);
//=> "[Function: formatDate]"
console.log(formatDate(new Date(), 'YYYY-MM-DD'));
//=> "2020-06-14"
</script>
@bitty/format-date
exports a function to format JavaScript Date
object using moment tokens.
import formatDate from '@bitty/format-date';
formatDate(new Date(), 'DD/MM/YYYY HH [hours] and mm [minutes].');
// I'm escaping "hours" and "minutes" using same syntax as moment.
Right now this lib supports the tokens below.
Token | Type | Range |
---|---|---|
DD | Day | 01 to 31 |
D | Day | 1 to 31 |
MM | Month | 01 to 12 |
M | Month | 1 to 12 |
YYYY | Year | 0000 to 9999 |
YY | Year | 0 to 99 |
HH | Hour | 00 to 23 |
H | Hour | 0 to 23 |
mm | Minute | 00 to 59 |
m | Minute | 0 to 59 |
ss | Second | 00 to 59 |
s | Second | 0 to 59 |
[*] | Escape |
Released under MIT License.
FAQs
A small library (around 400 B when gziped & minified) to format JavaScript `Date` object using same tokens as moment.
The npm package @bitty/format-date receives a total of 75 weekly downloads. As such, @bitty/format-date popularity was classified as not popular.
We found that @bitty/format-date demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
/Security News
North Korean threat actors deploy 67 malicious npm packages using the newly discovered XORIndex malware loader.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.