@ferrugemjs/compile

3.0.7 • Public • Published

@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.

NPM

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.");
    });
});

License

MIT License

Package Sidebar

Install

npm i @ferrugemjs/compile

Weekly Downloads

4

Version

3.0.7

License

MIT

Unpacked Size

33.1 kB

Total Files

6

Last publish

Collaborators

  • ferrugemjs