Date Since
Parses a javascript date and turns it into a "x time ago" format where time can be seconds, minutes, hours, days, or years.
example
> import dateSince from 'date-since'
> const time = new Date()
> console.log(dateSince(time))
2 seconds ago
methods
import dateSince from 'date-since';
dateSince(date)
returns a string that formats the date into the aforementioned format.
install
With npm do:
npm install date-since