@nkp/age
Get an approximate human readable number of years, months,days, hours, minutes, seconds between dates.
import { getAge } '@nkp/age';
// 1y1m2d
console.log(getAge(new Date(2021, 2, 3)));
Table of contents
Exports
@nkp/age
exports both CommonJS and ES modules.
Installation
npm
npm install @nkp/age
yarn
yarn add @nkp/age
pnpm
pnpm add @nkp/age
Publishing
To a release a new version:
- Update the version number in package.json
- Push the new version to the
master
branch on GitHub - Create a
new release
on GitHub for the latest version
This will trigger a GitHub action that tests and publishes the npm package.