@ethronjs/handlebars

0.1.0 • Public • Published

@ethronjs/handlebars

NPM version Total downloads

Handlebars support for Ethron.js.

Developed in Dogma, compiled to JavaScript.

Engineered in Valencia, Spain, EU by EthronLabs.

Use

const Handlebars = require("@ethronjs/handlebars");
const hbs = new Handlebars();

Methods

Helpers

registerHelper(name:string, hlpr:function) : this
hasHelper(name:string) : bool
removeHelper(name:string) : this

Partials

registerPartial(name:string, partial:function) : this
hasPartial(name:string) : bool
removePartial(name:string) : this

Rendering

async render(txt:string, data, opts:object) : string
async renderFile(file:string, data,l opts:object) : string

Built-in helpers

set name val object
and one two three...
or one two three...
http url
in collection value
nin collection value
not value
like value pattern
includes collection value
esc txt
lowercase txt
uppercase txt
capitalize txt
concat arg1 arg2 arg3...
replace txt str
replace txt str toSet
true value
false value
eq val1 val2
ne val1 val2
lt val1 val2
le val1 val2
gt val1 val2
ge val1 val2
iif cond whenTrue whenFalse
coalesce val1 val2 val3...
div val1 val2

Readme

Keywords

none

Package Sidebar

Install

npm i @ethronjs/handlebars

Weekly Downloads

2

Version

0.1.0

License

none

Unpacked Size

13.7 kB

Total Files

3

Last publish

Collaborators

  • ethronjs