1.0.1 • Published 1 year ago

@jlln/ago v1.0.1

Weekly downloads
-
License
ISC
Repository
github
Last release
1 year ago

Ago

This is a library that allows you to easily see how much time has passed based on the current date.

Recommended use of node version

node v14.6.x higher ( for used jest test )

Install

$ npm install @jlln/ago

How to Use

/* Test in 20221202 */
import { getAgo } from "@jlln/ago";

const ago = getAgo("1982-10-20 12:32:00");
console.log(ago); // 40 year

You can see more examples in my github repository. :)
Here example link

Options

nametypedescription
lang"ko" | "en"Display languege
display"YEAR" | "MONTH" | "WEEK" | "DAY" | "HOUR" | "MINUTE" | "SECONDS"Display result for selected time set
shortoptional\Apply to 'en' languege (ex) year => y
onlyDateoptional\Return only number value of Date
includeAgooptional\Optional auto include "a go" word

Test

$ npm run test

Author

Park Sung Jin (demnodey)

Use Library

  • dayjs