1.0.5 • Published 7 years ago
notzer.html2ntz v1.0.5
Notzer → html2ntz
Convert a HTML-File with CSS-Rules to the Notzer-Fileformat.
install
npm install notzer.html2ntz --save
usage
var fs = require("fs");
const html2ntz = require("notzer.html2ntz");
var html = String(fs.readFileSync("./index.html")); // the general HTML
var CSS = String(fs.readFileSync("./style.css")); // additional CSS
// parse html to ntz
let notzer = new html2ntz();
notzer.css.push(CSS);
// write notzer file
let output = JSON.stringify(notzer.parse(html), null, 4);
fs.writeFileSync("./test.ntz.json", output);