hbars

raw JSON →
0.1.7 verified Fri May 01 auth: no javascript deprecated

A shim repository for an HTMLBars template transpiler that uses a Haml-like syntax (Haml bars). The current version is 0.1.7, last updated in 2016. It is a niche tool for converting Haml-style templates into HTMLBars format for use with Ember.js or similar frameworks. No alternative comparison data is available due to low community adoption.

error Cannot find module 'hbars'
cause Package not installed or typo in name.
fix
Run npm install hbars and ensure no typos.
error hbars is not a function
cause Using default import instead of named imports.
fix
Use import { compile } from 'hbars' instead of import hbars from 'hbars'.
deprecated hbars is a shim repo; the main repo is https://github.com/code0100fun/hbars
fix Use the main repo directly.
gotcha Package has not been updated since 2016; may not work with modern Node.js.
fix Consider using an alternative template engine like Ember's built-in templating.
breaking ESM-only; CommonJS require() will fail.
fix Use ES import syntax or upgrade to a newer version if available.
npm install hbars
yarn add hbars
pnpm add hbars

Transpile a simple Haml-like template to HTMLBars syntax.

import { compile } from 'hbars';
const hbarsCode = '%h1 Hello, world!';
const htmlbarsCode = compile(hbarsCode);
console.log(htmlbarsCode);