Registry / web-framework / bemhtml-compat

bemhtml-compat

JSON →
library0.1.2jsnpmunverified

A transpiler that converts legacy BEMHTML source code (pre-2013 syntax) into modern JavaScript-compatible code for BEM frameworks. Current stable version is 0.1.2, with no active development since 2014. It is a specialized tool for migrating BEMHTML templates from the old declarative format to the new functional style using `match()` calls. Its key differentiator is handling the syntax shift in BEM libraries, but it has been superseded by direct development on BEMHTML and is no longer maintained.

npm install bemhtml-compat
INSTALL
IMPORT
SIG · BEMHTML-COMPAT
B
bemhtml-compat
web-frameworkjavascriptv0.1.2
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.

default
import bemcompat from 'bemhtml-compat'
const bemcompat = require('bemhtml-compat')
ESM import is preferred; CommonJS require also works but is outdated.
transpile
import { transpile } from 'bemhtml-compat'
import transpile from 'bemhtml-compat'
transpile is a named export, not default.

Transpiles an old-style BEMHTML block declaration to modern JavaScript.

import bemcompat from 'bemhtml-compat'; const result = bemcompat.transpile('block b1, tag: "a"'); console.log(result); // match(this.block === 'b1', this._mode === 'tag')('a');
Debug
Known issues
gotchaPackage is no longer maintained and has been abandoned since 2014. No compatibility with modern Node.js versions beyond v0.10.
fix
Use the built-in BEMHTML transpilation features in the 'bem' package or write templates directly in modern BEMHTML syntax.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Cannot find module 'bemhtml-compat'
Package not installed or removed from npm? It still exists but is not maintained.
fix
Run 'npm install bemhtml-compat' (version 0.1.2). If that fails, the package may have been unpublished.
Upgrade
Version history
0.1.2latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
10
OpenAI (training)
1
Resources
bemhtml-compat — npm install bemhtml-compat · libregistry