I do not think you need to use the server version. Use npm stuff only on server side and btw, put it in your / public /. Who knows, maybe you can call him when he is in your / public /, try it. Or try this one.
Use something like jquery timeago.js
Put it in / client / or something like / client / js
Create / client / helpers.js or some of them.
Use the helper helm.
Handlebars.registerHelper('date', function(date) { if(date) { dateObj = new Date(date); return $.timeago(dateObj); } return 'a long long time ago in a galaxy far away'; });
An example of calling the date function handlebars helper from a template.
{{ date created }}
Where the date is handebars helper and a date is created that leaves the meteor / mongo collection.
See the github Britto project. This is where I got this piece of code and used it in a chat application that I wrote. It works great.
There are a couple of others. Go to madewith.meteor.com and check out the source of some of the projects.
Steeve cannon
source share