Skip to content

Get a human readable number of years, months, days, hours, minutes, seconds between dates. For example, 2h3m1d8h15m2s.

License

Notifications You must be signed in to change notification settings

NickKelly1/nkp-age

Repository files navigation

@nkp/age

npm version deploy status known vulnerabilities

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:

  1. Update the version number in package.json
  2. Push the new version to the master branch on GitHub
  3. Create a new release on GitHub for the latest version

This will trigger a GitHub action that tests and publishes the npm package.

About

Get a human readable number of years, months, days, hours, minutes, seconds between dates. For example, 2h3m1d8h15m2s.

Resources

License

Stars

Watchers

Forks

Packages

No packages published