JSPM

@jlln/ago

1.0.0
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 2
  • Score
    100M100P100Q29027F
  • License ISC

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

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.

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

Install

$ npm install @jlln/ago

or

$ yarn add @jlln/ago

How to Use

Default

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

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

Global language setting

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

// Setting global config for language
setGlobalLang("en");

const ago = getAgo("2022-01-02 12:00:00");
console.log(ago); // 10 months a go

Test

$ npm run test

or

$ yarn test

Author

Park Sung Jin (demnodey)

Use Library

  • dayjs