forked from mudassir0909/jsonresume-theme-elegant
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrender.js
More file actions
26 lines (24 loc) · 610 Bytes
/
render.js
File metadata and controls
26 lines (24 loc) · 610 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//
// This script will render the response and write it to the index.html file.
//
// Usage:
// `node render`
//
require("resume-schema");
let fs = require('fs');
let theme = require("./index.js");
fs.writeFile("./build/index.html", render(), function (err) {
if (err) {
console.log(err);
} else {
console.log("index.html written to build folder.");
}
});
function render() {
try {
return theme.render(JSON.parse(fs.readFileSync("./node_modules/resume-schema/sample.resume.json", "utf8")));
} catch (e) {
console.log(e.message);
return "";
}
}