Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spoonx/to-age
An extremely simple module that converts a date to an age.
https://github.com/spoonx/to-age
Last synced: about 1 month ago
JSON representation
An extremely simple module that converts a date to an age.
- Host: GitHub
- URL: https://github.com/spoonx/to-age
- Owner: SpoonX
- License: mit
- Created: 2016-03-20T15:30:48.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-03-20T15:50:11.000Z (almost 9 years ago)
- Last Synced: 2024-11-19T23:27:27.844Z (about 1 month ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 2
- Watchers: 3
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
README
# to-age
An extremely simple module that converts a date to an age.> $ toAge('1991-04-24'); // 24 (at time of writing)
## Installing
`npm i to-age --save`
## Usage
```js
var toAge = require ('to-age');// From an instance
toAge(new Date(1991, 4, 24));// From a string
toAge('1991-04-24');
```