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: 12 months ago
JSON representation

An extremely simple module that converts a date to an age.

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');
```