simple-template-engine

1.0.3 • Public • Published

Build Status Coverage Status npm version Run on Repl.it

Simple Template Engine

Usage

var templeteEngine = require('./simple_templating_engine.js');
var template = "Hello, <% change_me %>";
 
 
var handler = function(key) { return { '<% change_me %>': 'World' } };
templeteEngine.populate(template, handler).then(populated => {
    console.log(populated);
});
 
 
handler = function(key) { return { '<% change_me %>': 'Async World' } };
 
(async function() {
  let populated = await templeteEngine.populate(template, handler);
  console.log(populated);
})();
 

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 1.0.3
    19
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 1.0.3
    19
  • 1.0.2
    0
  • 1.0.1
    0
  • 1.0.0
    0

Package Sidebar

Install

npm i simple-template-engine

Weekly Downloads

19

Version

1.0.3

License

ISC

Unpacked Size

75 kB

Total Files

13

Last publish

Collaborators

  • billykong