Skip to content

Instantly share code, notes, and snippets.

@nailkhasipov
Created October 9, 2017 05:55
Show Gist options
  • Save nailkhasipov/e91d6d7e6bc6c582034223fe5fb7f265 to your computer and use it in GitHub Desktop.
Save nailkhasipov/e91d6d7e6bc6c582034223fe5fb7f265 to your computer and use it in GitHub Desktop.
var mustache = require("mustache");
var fs = require("fs");
fs.readFile("app/views/index.mustache", function (err, data) {
if (err) throw err;
var output = mustache.render(data.toString(), {});
fs.writeFile('public/index.html', output, function (err) {
if (err) throw err;
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment