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
- Host: GitHub
- URL: https://github.com/ecto/node-timeago
- Owner: ecto
- Created: 2011-10-06T16:37:27.000Z (over 14 years ago)
- Default Branch: master
- Last Pushed: 2014-09-30T19:59:06.000Z (over 11 years ago)
- Last Synced: 2025-06-09T04:43:33.374Z (about 1 year ago)
- Language: JavaScript
- Homepage:
- Size: 146 KB
- Stars: 45
- Watchers: 3
- Forks: 7
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# timeago
A wrapper for Ryan McGeary's [jQuery plugin](http://timeago.yarp.com/).

#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) %>
````