Registry / web-framework / mahal-html-compiler

mahal-html-compiler

JSON →
library1.4.1jsnpmunverified

Official HTML compiler for the Mahal framework (v1.4.1). Transforms Mahal-specific HTML templates into render functions, supporting directives, expressions, and component nesting. Designed exclusively for Mahal's reactive UI system, it is tightly coupled to the framework and not intended for standalone use. Releases are less frequent, tied to Mahal updates. Ships TypeScript types.

npm install mahal-html-compiler
INSTALL
IMPORT
SIG · MAHAL-HTML-COMPILE
M
mahal-html-compiler
web-frameworkjavascriptv1.4.1
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 'mahal-html-compiler'
const compile = require('mahal-html-compiler').compile
ESM-only; CommonJS require will fail in Node.js ESM context
MahalHTMLCompiler
import { MahalHTMLCompiler } from 'mahal-html-compiler'
import MahalHTMLCompiler from 'mahal-html-compiler'
Named export, not default
CompileOptions
import type { CompileOptions } from 'mahal-html-compiler'
TypeScript users should use `import type` for type-only imports

Compiles a simple Mahal template with an interpolation expression.

import { compile } from 'mahal-html-compiler'; const template = '<div>{{ message }}</div>'; const options = { filename: 'App.mahal' }; const result = compile(template, options); console.log(result.code);
Debug
Known issues
breakingRequires Mahal framework >=1.0.0; not backward compatible with older Mahal versions.
fix
Ensure your project uses Mahal >=1.0.0.
affects: >=1.0.0
gotchaDoes not support runtime compilation in browser; templates must be precompiled.
fix
Precompile templates during build step using Mahal CLI or bundler plugin.
affects: all
gotchaErrors in template syntax produce cryptic parse errors; no line-level error mapping.
fix
Validate templates manually before compilation.
affects: all
Errors
Common errors & fixes
Cannot find module 'mahal-html-compiler' require() of ES Module
Using require() instead of import.
fix
Use ES module import syntax.
TypeError: compile is not a function
Incorrect import: default import instead of named import.
fix
Use `import { compile } from 'mahal-html-compiler'`
Upgrade
Version history
1.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
mahal-html-compiler — npm install mahal-html-compiler · libregistry