Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
A small library that provides a few very useful methods for displaying dates, including a formatter and a parser.
$ npm install dateable
var dateable = require('dateable');
var date = new Date(2009, 4, 23);
var str = dateable(date, 'MM/DD-YYYY, hh:mm');
// => 05/23-2012, 22:10
Parse a formatted date and return the original Date object
dateable.parse(str, 'MM/DD-YYYY, hh:mm');
// => Sat May 23 2009 00:00:00 GMT+0000 (CEST)
If you want to include text in the formatting, you need to escape it with either ' or ".
var format = '"I went to the moon a" dddd "in" MMMM, YYYY';
dateable(date, format);
// => I went to the moon a Saturday in May, 2009
You can also get the relative date, and the difference between dates.
dateable.when(new Date(2008, 4, 20));
// => 4 years ago
dateable.when(new Date(2020, 4, 30));
// => in 8 years
dateable.diff(new Date(2015), new Date());
// => 3 years
Return formatted date
Return original date from format
Returns relative date
Returns the difference between the two dates
Set language
Based on ISO 8601 with some additions. See tests for examples.
MIT
FAQs
A date formatter and parser for node
The npm package dateable receives a total of 1,789 weekly downloads. As such, dateable popularity was classified as popular.
We found that dateable demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.