whendys
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

when, never why

Whendys is a small library used to get the time since a Date represented in an edible readable format.

"8 hours ago"

Example

import {when} from 'whendys'

// pretend it's June 23, 2021!

// String
let delay = when('June 26, 2020') // => 11 months ago

// Date object
delay = when(new Date('June 22 2021'))  // => 1 day ago

// Milliseconds
delay = when(1623643200000) // => 1 week ago

Readme

Keywords

none

Package Sidebar

Install

npm i whendys

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

12 kB

Total Files

15

Last publish

Collaborators

  • kysley