@ferrugemjs/compile
v3.0.7
Published
a node package to convert html template to Incremental DOM
Downloads
12
Maintainers
Readme
@ferrugemjs/compile
a npm package to convert html to incremental dom
@ferrugemjs/compile
ferrugemjs-node is a simple node package to converte template HTML engine to google incremental-DOM.
Install
'npm install @ferrugemjs/compile --save-dev'
Usage
var ferrugemjs_compile = require('@ferrugemjs/compile');//import the plugin
// your code here!!
ferrugemjs_compile('<template><div>test</div></template>',<<options>>)
Options
{
templateExtension: ".html",
env: "production" // default is "development"
}
Usage
const fs = require("fs");
//import the plugin
const ferrugemjs_compile = require('@ferrugemjs/compile');
const filePath = "test/app/main-app.html";
fs.readFile(filePath, function (err, buf) {
const compiledStr = ferrugemjs_compile(buf.toString(), {
templateExtension: ".html",
viewModel: "main-app",
env: "production" // default is "development"
})
fs.writeFile(`${filePath}.js`, compiledStr, (err) => {
if (err) console.log(err);
console.log("Successfully Written to File.");
});
});