Closed chocolateboy closed 9 years ago
Will definitely consider this, but I'm also trying to be conscious of not trying to do everything in a single module. For my own blog, I first preprocess my data with https://github.com/debrouwere/refract (which allows you to load .js
and .coffee
helpers) and then pass on the data to render
only when it looks exactly like it should.
Not closing, but need to think about it more.
+1. Loading .json
and .js
files are usually treated interchangeably in node. Confert is basically consolidate for configs, it should simplify your code while supporting more file types.
The crowd has spoken. Thanks for the tip, @dskrepps, we're loading files with Confert now. Only JSON files have unit tests now, but might add some for .js
and such later. Meanwhile, feel free to check it out.
e.g.:
It would be handy if there was a way to expose dynamic properties — like, say, the date or Node.js version — to templates. A common way of achieving this is to load files with a
.js
extension and operate on their default export (i.e. viamodule.exports
). This is done by e.g. jpm and various other tools and libraries.