
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
semantic-date
Advanced tools
Convert natural language time spans to Date objects
$ npm install semantic-date
semanticDate = require 'semantic-date'
semanticDate.validate "last year"
> true
semanticDate.convert "last year"
> { start: Wed Jan 01 2014 00:00:00 GMT-0500 (EST),
end: Thu Jan 01 2015 00:00:00 GMT-0500 (EST) }
Provide a Date object as the second parameter to convert to use that date as the reference:
semanticDate.convert "last hour", new Date(2011, 3, 4, 3, 0, 0)
> { start: Mon Apr 04 2011 02:00:00 GMT-0400 (EDT),
end: Mon Apr 04 2011 03:00:00 GMT-0400 (EDT) }
The following are the semantic dates which are currently understood. More and more permutations of the current ones will be added over time. Feel free to send me a PR with your favorite form.
Hypens and underscores are supported in place of spaces.
$ npm test
FAQs
Convert natural language time spans to Date objects
The npm package semantic-date receives a total of 28 weekly downloads. As such, semantic-date popularity was classified as not popular.
We found that semantic-date 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.