A basic configurable template engine with conditionals and variable replacement.


1.0.03 years ago3 years agoMinified + gzip package size for @inst-app/basic-template in KB



A blazing fast(tm) template engine with just properties and conditionals out of the box

let t = compile('hello, {% name %} {? sayMyLastName ?}{% lastName %}{??}')
t({name: 'jared', lastName: 'lunde'})
t({name: 'jared', lastName: 'lunde', sayMyLastName: true})

let t = compile(`
  hello, {% name %}
  {? sayMyLastName > 1 ?}
    {% lastName %}
t({name: 'jared', lastName: 'lunde', sayMyLastName: 0})
t({name: 'jared', lastName: 'lunde', sayMyLastName: 2})

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.