🎉 Generating html templates for each svg files

This commit is contained in:
KaizIqbal 2020-07-25 17:42:36 +05:30
parent 4e44cb47e0
commit 4d63be07ac

View file

@ -1,5 +1,21 @@
import fs from "fs";
import { generateRenderTemplate } from "./htmlTemplate";
import { svgs } from "./config";
(async () => {
svgs.map((svg: string) => console.log(svg));
// iterate over all .svg files
svgs.forEach((svg) => {
// reading file
fs.readFile(svg, "utf8", (error, data) => {
if (error) {
return console.log(error);
}
// Generating HTML Template
const template = generateRenderTemplate(data);
console.log(template);
});
});
})();