Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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.

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