{"id":25568,"library":"factory-transpiler","title":"Factory Transpiler","description":"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.","status":"active","version":"2.4.1","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/Plixo2/FactoryTranspiler","tags":["javascript","html-transpiler","html","transpiler","factory"],"install":[{"cmd":"npm install factory-transpiler","lang":"bash","label":"npm"},{"cmd":"yarn add factory-transpiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add factory-transpiler","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only since v2; CommonJS require is not supported.","wrong":"const Transpiler = require('factory-transpiler')","symbol":"Transpiler","correct":"import { Transpiler } from 'factory-transpiler'"},{"note":"Named export, not default.","wrong":"import transpile from 'factory-transpiler'","symbol":"transpile","correct":"import { transpile } from 'factory-transpiler'"}],"quickstart":{"code":"import { transpile } from 'factory-transpiler';\n\nconst factoryCode = `\nmeta(charset=\"UTF-8\")\ndiv(a=\"a\") {\n    div(b=\"b\") {\n        div(c=\"c\" test) {\n            \"text\"\n        }\n    }\n}\n`;\n\nconst htmlOutput = transpile(factoryCode);\nconsole.log(htmlOutput);\n// Output:\n// <meta charset=\"UTF-8\" />\n// <div a=\"a\">\n//     <div b=\"b\">\n//         <div c=\"c\" test>\n//             text\n//         </div>\n//     </div>\n// </div>","lang":"typescript","description":"Demonstrates importing the transpile function and converting Factory syntax to HTML."},"warnings":[{"fix":"Ensure all tags follow the pattern: tagname(attr1=\"val1\") { child } or tagname() for singletons.","message":"Factory syntax uses parentheses for attributes and curly braces for children; do not mix them incorrectly.","severity":"gotcha","affected_versions":">=0.1.0"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install factory-transpiler' and ensure your project is ESM (use 'type':'module' in package.json).","cause":"Package not installed or not resolved.","error":"Cannot find module 'factory-transpiler'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}