nbars
v1.1.0
Published
The tiniest and fastest javascript templating engine inspired by the fully featured Handlebarsjs
Downloads
2,424
Maintainers
Readme
nbars
The tiniest and fastest javascript templating engine inspired by the fully featured Handlebarsjs only 180 Bytes!
install
npm install nbars --save
Use
Node.js
const {NBars} = await import("nbars");
Browser
import NBars from "nbars";
Example
const {NBars} = await import("nbars");
//execute and "compile" in one.
console.log(
NBars.transform(
"Hello this is {{what}} of {{thing}} memes",
{
what:"bees?",
thing:"fire"
}
)
);
// The Handlebars Way.
var template = NBars.compile("NBars is such a tiny <b>{{thing}}</b>");
// execute the compiled template and print the output to the console
console.log(
template(
{
thing: "mustache!"
}
)
);