utils-time-elapsed
v1.0.2
Published
A tiny utility to convert timestamps into human-readable 'time ago' strings like '5 minutes ago', '2 days ago', or 'just now'.
Readme
utils-time-elapsed
Convert timestamps into human-readable "time ago" strings like "5 minutes ago", "2 days ago", or "5 hours and 34 minutes ago".
Features
🔹 Lightweight and fast
🔹 Works with Date objects, timestamps, or ISO strings
🔹 Supports seconds, minutes, hours, days, weeks, months, and years
🔹 No dependencies
🔹 Optional locale/customization support (if applicable)
📘 API utils-time-elapsed(inputDate: string | number): string Returns a human-readable relative time string compared to Date.now().
Arguments: inputDate – A timestamp, or ISO string.
Returns: A string like "5 minutes ago", "2 days ago", "5 hours and 34 minutes ago", etc.
📄 License MIT © 2025
🙌 Contributing PRs welcome! Feel free to open issues or suggest improvements.
