After becoming fond with mustache.js template-style, I would like continue using it in node.js.
I’ve been able to install it and confirm that it’s working, but I just can’t get my head around how to use it to template files.
How do I load a template called template.html and apply mustache’s magic to it within node.js?
fs.readFileSyncis the synchronous version offs.readFile, so it will be blocking. Here’s a basic example of how you could usefs.readFilewith mustache.js which would return the mustache template in the callback.