@mockingbot/timeago

A wrapper for Ryan McGeary's Pretty Date function

Stats

StarsIssuesVersionUpdatedCreatedSize
@mockingbot/timeago
0.2.04 years ago4 years agoMinified + gzip package size for @mockingbot/timeago in KB

Readme

timeago

A wrapper for Ryan McGeary's jQuery plugin.

timeago

#install

npm install timeago

#usage

var timeago = require('timeago');

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

console.log(pretty); // just now

You can also use it in Express app templates:

var app = express.createServer();

app.helpers({
  timeago: require('timeago')
});
<div class="timeago"><%- timeago(widget.created) %></div>

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.