age-in-words
v1.0.5
Published
A module that expresses your age in words. Accepts birthdate as parameter.
Downloads
4
Readme
Age in Words
Express age in words. Accepts birthdate as constructor.
Installation
yarn add age-in-words
Usage
const age = ageInWords(date, options);
date (required):
- Format: 'RFC-822', 'MM/DD/YYY', YYYY/MM/DD'
options (optional):
- `specialCases` (optional): default - true
See specialCases.js for list of renames if enabled
Example
const ageInWords = import 'age-in-words';
const age = ageInWords('2016-10-12');
console.log(age); //18 months old
Using https://github.com/lukeed/fromNow as a starting point.