1.1.0 • Published 3 years ago

nbars v1.1.0

Weekly downloads
237
License
MIT
Repository
github
Last release
3 years ago

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