Registry / web-framework / factory-transpiler

factory-transpiler

JSON →
library2.4.1jsnpmunverified

Factory Transpiler is a JavaScript library that converts a custom, CSS-like syntax (Factory) into HTML. It supports normal tags, singleton elements, text nodes, auto-formatting, and error detection. Version 2.4.1 is current, with a simple API: one function call to transpile Factory strings to HTML. It differentiates from template engines like Pug by offering a lighter, dependency-free approach focused purely on syntax transformation, with no runtime templating or data binding.

npm install factory-transpiler
INSTALL
IMPORT
SIG · FACTORY-TRANSPILER
F
factory-transpiler
web-frameworkjavascriptv2.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.

Transpiler
import { Transpiler } from 'factory-transpiler'
const Transpiler = require('factory-transpiler')
ESM-only since v2; CommonJS require is not supported.
transpile
import { transpile } from 'factory-transpiler'
import transpile from 'factory-transpiler'
Named export, not default.

Demonstrates importing the transpile function and converting Factory syntax to HTML.

import { transpile } from 'factory-transpiler'; const factoryCode = ` meta(charset="UTF-8") div(a="a") { div(b="b") { div(c="c" test) { "text" } } } `; const htmlOutput = transpile(factoryCode); console.log(htmlOutput); // Output: // <meta charset="UTF-8" /> // <div a="a"> // <div b="b"> // <div c="c" test> // text // </div> // </div> // </div>
Debug
Known issues
gotchaFactory syntax uses parentheses for attributes and curly braces for children; do not mix them incorrectly.
fix
Ensure all tags follow the pattern: tagname(attr1="val1") { child } or tagname() for singletons.
affects: >=0.1.0
Errors
Common errors & fixes
Cannot find module 'factory-transpiler'
Package not installed or not resolved.
fix
Run 'npm install factory-transpiler' and ensure your project is ESM (use 'type':'module' in package.json).
Upgrade
Version history
2.4.1latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
2 hits · last 30 days
node
2
Resources
factory-transpiler — npm install factory-transpiler · libregistry