Registry / web-framework / hbars
library0.1.7jsnpmunverified

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.

npm install hbars
INSTALL
IMPORT
SIG · HBARS
H
hbars
web-frameworkjavascriptv0.1.7
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

compile
import { compile } from 'hbars'
const compile = require('hbars').compile
ESM-only since v0.1.0
parse
import { parse } from 'hbars'
const hbars = require('hbars'); hbars.parse()
Named export only; no default export.
default
import hbars from 'hbars'
const { default: hbars } = require('hbars')
Default export exists but deprecated; use named exports.

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);
Debug
Known issues
deprecatedhbars is a shim repo; the main repo is https://github.com/code0100fun/hbars
fix
Use the main repo directly.
affects: >=0.0.0
gotchaPackage 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.
affects: >=0.1.0
breakingESM-only; CommonJS require() will fail.
fix
Use ES import syntax or upgrade to a newer version if available.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'hbars'
Package not installed or typo in name.
fix
Run `npm install hbars` and ensure no typos.
hbars is not a function
Using default import instead of named imports.
fix
Use `import { compile } from 'hbars'` instead of `import hbars from 'hbars'`.
Upgrade
Version history
0.1.7latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
6 hits · last 30 days
node
6
Resources
hbars — npm install hbars · libregistry