4.7.7-4 • Published 2 years ago

@fiug/handlebars-esm v4.7.7-4

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

@fiug/handlebars-esm

a port of Handlebars to esm compatable module

Usage

in browser

{{!-- template.hbs --}}
<div>
  foo = "{{foo}}"
</div>
// module.mjs
import handlebars from "https://unpkg.com/@fiug/handlebars-esm";

const template = await handlebars.compile({
  path: new URL(import.meta.url).href + '/../template.hbs'
});

const templateVars = {
  foo: "bar"
};

document.body.innerHTML = template(templateVars);

in node

npm i @fiug/handlebars-esm --save
import Handlebars from "@fiug/handlebars-esm";

const template = handlebars.compile(`
<div>
  foo = "{{foo}}"
</div>
`);

const templateVars = {
  foo: "bar"
};

console.log(template(templateVars));
4.7.7-4

2 years ago

4.7.7-1

2 years ago

4.7.7

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago