nbars

1.1.0 • Public • Published

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

Package Sidebar

Install

npm i nbars

Weekly Downloads

575

Version

1.1.0

License

MIT

Unpacked Size

3.76 kB

Total Files

7

Last publish

Collaborators

  • phara0h