Skip to content

Instantly share code, notes, and snippets.

@Altreus
Last active August 29, 2015 13:56
Show Gist options
  • Save Altreus/9197577 to your computer and use it in GitHub Desktop.
Save Altreus/9197577 to your computer and use it in GitHub Desktop.
fs.readdir(dir, function(err, files){
for(x in files){
let fn = files[x];
if (! fn.match(/\.html$/)) {
continue;
}
fs.readFile(
dir + '/' + fn,
{encoding : 'utf8'},
function(err, data) {
templates[fn] = hogan.compile(data);
};
);
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment