npm.io
1.1.0 • Published 5 years ago

nbars

Licence
MIT
Version
1.1.0
Deps
0
Size
4 kB
Vulns
0
Weekly
0
Stars
2

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