barbe
Like mustache, but simple, tiny and fast.
Installation
$ npm install barbe
Example
var Barbe = require("barbe");
console.log(Barbe("Hello {world}!", {
world: "Mars"
}));
console.log(Barbe("Hello <world>!", ["<", ">"], {
world: "World"
}));
console.log(Barbe("Hello ###world##!", ["###", "##"], {
world: function () {
return "Sun";
}
}));
Documentation
Barbe(text, arr, data)
Renders the input template including the data.
Params
- String
text
: The template text. - Array
arr
: An array of two elements: the first one being the start snippet (default: "{"
) and the second one being the end snippet (default: "}"
). - Object
data
: The template data.
Return
- String The rendered template.
How to contribute
- File an issue in the repository, using the bug tracker, describing the
contribution you'd like to make. This will help us to get you started on the
right foot.
- Fork the project in your account and create a new branch:
your-great-feature
. - Commit your changes in that branch.
- Open a pull request, and reference the initial issue in the pull request
message.
License
See the LICENSE file.