
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
relative-date-component
Advanced tools
Relative dates in words
$ component install component/relative-date
Return the date in words relative to Date.now():
var relative = require('relative-date');
var date = new Date(Date.now() + 2000);
var str = relative(date) + ' ago';
// => "2 seconds ago"
An empty string "" is returned when the difference
is below one second. You may use this to default
the string as shown here:
var str = relative(new Date) || 'just now';
// => "just now"
var str = relative(new Date);
if (str) str = 'assignment due in ' + str;
else str = 'assignment due';
// => "assignment due"
Same as above, relative to other instead of Date.now().
MIT
FAQs
Relative date in words
The npm package relative-date-component receives a total of 5 weekly downloads. As such, relative-date-component popularity was classified as not popular.
We found that relative-date-component 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.