0.1.9 • Published 2 years ago

bigotes v0.1.9

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

Bigotes

This is a simple re-implementation of Mustache with direct support for internationalization (i18n-style). It can be used directly as a view engine in Express:

var bigotes = require('bigotes');
app.engine ("bgt",bigotes);	// files with ".bgt" extension are rendered by Bigotes

It can also be used without a view engine, by calling .compile:

var bigotes = require('bigotes');
var str = "Hello, {{name}}!";
var template = bigotes.compile (str);   // compiles mustache string into a Javascript function
var text = template ( {name:"John"} );  // (the javascript function takes data as argument)
console.log(text);                      // displays: Hello, John!

I18n-style internationalization is supported directly, by using double-quotes:

var bigotes = require('bigotes');
var str = '{{"Hello"}}, {{name}}!';
var template = bigotes.compile (str);
var text = template ( {name:"John"}, i18n );  // where i18n is some object with a "__" method.
console.log(text);     // displays: Hola, John!
0.1.9

2 years ago

0.1.8

9 years ago

0.1.7

9 years ago

0.1.6

9 years ago

0.1.5

9 years ago

0.1.4

9 years ago