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

https://github.com/ecto/node-timeago

:clock9: Humanized time for node apps
https://github.com/ecto/node-timeago

Last synced: 12 months ago
JSON representation

:clock9: Humanized time for node apps

Awesome Lists containing this project

README

          

# timeago

A wrapper for Ryan McGeary's [jQuery plugin](http://timeago.yarp.com/).

![timeago](http://i.imgur.com/W1Zwy.png)

#install

npm install timeago

#usage

````javascript
var timeago = require('timeago');

var pretty = timeago(+new Date());

console.log(pretty); // just now
````

You can also use it in Express app templates:

````javascript
var app = express.createServer();

app.helpers({
timeago: require('timeago')
});
````

````ejs

<%- timeago(widget.created) %>

````