{"id":26308,"library":"remixml","title":"Remixml","description":"Remixml is an XML/HTML-like macro language and template compiler engine for JavaScript, currently at v7.0.11. It compiles templates directly into minified JavaScript with zero runtime dependencies, supports auto-escaping, asynchronous control, user-defined tags, filters, and whitespace preservation. Unlike many templating engines, Remixml uses XML entities (e.g., &scope.varname;) instead of artificial delimiters, integrates smoothly with existing XHTML/HTML syntax highlighting, and includes a validating XHTML parser. It runs in Node.js (ES2018+) and modern browsers, with a runtime size under 7 KB gzipped.","status":"active","version":"7.0.11","language":"javascript","source_language":"en","source_url":"git://github.com/BuGlessRB/remixml","tags":["javascript","templating","XHTML","HTML","parser","compiler","autoescape","template"],"install":[{"cmd":"npm install remixml","lang":"bash","label":"npm"},{"cmd":"yarn add remixml","lang":"bash","label":"yarn"},{"cmd":"pnpm add remixml","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM default import; CJS require() works but no named exports available.","wrong":"const Remixml = require('remixml')","symbol":"Remixml","correct":"import Remixml from 'remixml'"},{"note":"parse2txt is a method on the default export, not a named export.","wrong":"import { parse2txt } from 'remixml'","symbol":"parse2txt","correct":"import Remixml from 'remixml'; Remixml.parse2txt(template, data)"},{"note":"compile is a method on the default export. For CJS: const Remixml = require('remixml'); Remixml.compile(...).","wrong":"const { compile } = require('remixml')","symbol":"compile","correct":"import Remixml from 'remixml'; const compiled = Remixml.compile(template)"}],"quickstart":{"code":"import Remixml from 'remixml';\n\nconst data = {\n  _: {\n    sitename: 'Example',\n    description: 'quick start'\n  },\n  var: {\n    items: ['foo', 'bar', 'baz']\n  }\n};\n\nconst template = `\n<h1>&_.sitename; - &_.description;</h1>\n<ul><for list=\"&var.items;\">\n  <li>&_._value;</li>\n</for></ul>\n`;\n\nconst output = Remixml.parse2txt(template, data);\nconsole.log(output);\n// <h1>Example - quick start</h1>\n// <ul>\n//   <li>foo</li>\n//   <li>bar</li>\n//   <li>baz</li>\n// </ul>","lang":"javascript","description":"Demonstrates basic Remixml usage: parsing a template with variable substitution and a loop."},"warnings":[{"fix":"Use &scope.varname; syntax for all template variables.","message":"Variable names must contain at least one dot (e.g., &scope.varname;). Plain ampersand entities like &varname; are treated as HTML entities, not Remixml variables.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use <for list=\"&var.items;\"> where items is an array. For objects, use RXML library or custom tag.","message":"In <for list=\"...\">, the list value must be a string expression resolving to an array; objects are not directly iterable with <for>.","severity":"gotcha","affected_versions":">=1.0"},{"fix":"Use <set> and <for> loops to access array elements or pass them as data properties.","message":"The official documentation suggests using entities like &var.arrays.1; for array indexing, but this is fragile and not recommended.","severity":"deprecated","affected_versions":">=1.0"},{"fix":"Use import Remixml from 'remixml' and call Remixml.parse2txt() directly; do not instantiate.","message":"In v7, the default export changed from a constructor to a plain object with static methods. Old code using 'new Remixml()' will break.","severity":"breaking","affected_versions":">=7.0.0"},{"fix":"Use <autoescape>on</autoescape> or apply filters to variables: &escape.htmlescape(var.foo);","message":"Remixml does not escape HTML in variable values by default; you must explicitly use autoescape filters or entity encoding.","severity":"gotcha","affected_versions":">=1.0"}],"env_vars":null,"search_vec":"'7':81 'artifici':53 'asynchron':32 'auto':30 'auto-escap':29 'autoescap':90 'browser':75 'compil':10,18,89 'control':33 'current':14 'defin':36 'delimit':54 'depend':27 'direct':20 'e.g':50 'engin':11,45 'entiti':49 'es2018':72 'escap':31 'exist':58 'filter':38 'gzip':83 'highlight':61 'html':87 'includ':63 'instead':51 'integr':55 'javascript':13,23,84 'kb':82 'languag':7 'macro':6 'mani':43 'minifi':22 'modern':74 'node.js':71 'parser':67,88 'preserv':41 'remixml':1,2,46 'run':69 'runtim':26,78 'size':79 'smooth':56 'support':28 'syntax':60 'tag':37 'templat':9,19,44,85,91 'unlik':42 'use':47 'user':35 'user-defin':34 'v7.0.11':16 'valid':65 'whitespac':40 'xhtml':66,86 'xhtml/html':59 'xml':48 'xml/html-like':5 'zero':25","created_at":"2026-05-01T13:49:18.944351+00:00","updated_at":"2026-05-01T13:49:18.944351+00:00","problems":[{"fix":"Use static methods: import Remixml from 'remixml'; Remixml.parse2txt(...);","cause":"Attempting to instantiate Remixml with 'new Remixml()' in v7+.","error":"Uncaught TypeError: Remixml is not a constructor"},{"fix":"Ensure data object has the scope as a nested object: { _: { sitename: 'value' } }","cause":"Variable name does not start with a valid scope prefix (e.g., '_', 'var', 'anything') or data object is missing the scope.","error":"Error: Entity '._.sitename' not found"},{"fix":"Add </for> or self-close the tag if using a different form.","cause":"The <for> tag requires a </for> closing tag. Remixml is strict about well-formed XML/XHTML.","error":"Error: Missing closing tag for '<for>'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":"","cli_version":null,"type":"library","homepage":"https://remixml.org","github":"https://github.com/BuGlessRB/remixml","docs":null,"changelog":null,"pypi":null,"npm":"https://www.npmjs.com/package/remixml","openapi_spec":null,"status_page":null,"smithery":null,"categories":["web-framework","serialization"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-05-01","next_check":"2026-07-30","install_tag":null}}