Package Exports
- @jlln/ago
- @jlln/ago/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@jlln/ago) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
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
name | type | description |
---|---|---|
lang | "ko" | "en" | Display languege |
display | "YEAR" | "MONTH" | "WEEK" | "DAY" | "HOUR" | "MINUTE" | "SECONDS" | Display result for selected time set |
short | optional<boolean> | Apply to 'en' languege (ex) year => y |
onlyDate | optional<boolean> | Return only number value of Date |
includeAgo | optional<boolean> | Optional auto include "a go" word |
Test
$ npm run test
Author
Park Sung Jin (demnodey)
Use Library
- dayjs