one-upon-a-time
v2.0.0
Published
A simple npm package to convert timestamps to human-readable formats like "3 minutes ago" or "just now".
Downloads
4
Readme
one-upon-a-time
A simple npm package to convert timestamps to human-readable formats like "3 minutes ago" or "just now".
Installation
npm install one-upon-a-timeUsage
const formatTimestamp = require('one-upon-a-time');
const threeMinutesAgo = new Date(Date.now() - 3 * 60 * 1000);
console.log(formatTimestamp(threeMinutesAgo)); // "3 minutes ago"