{"id":27147,"library":"mithril-template","title":"mithril-template","description":"HTML to Mithril hyperscript transpiler that converts HTML templates into Mithril's virtual DOM hyperscript (m()) calls. Version 0.0.1, early stage, no formal release cadence. Supports interpolation (mustache syntax), binding attributes with colon prefix, component embedding (kebab-case to camelCase), and directives (if/elseif/else/for). Differentiates from similar tools by its directive system and non-standard component naming conventions. Limited documentation and no ongoing maintenance observed.","status":"abandoned","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/mikejav/mithril-template","tags":["javascript","mithril","mithril-template","hyperscript","virtual-DOM","html-transpiler"],"install":[{"cmd":"npm install mithril-template","lang":"bash","label":"npm"},{"cmd":"yarn add mithril-template","lang":"bash","label":"yarn"},{"cmd":"pnpm add mithril-template","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"CommonJS only; no ES module export. Use require() as shown.","wrong":"import mithrilTemplate from 'mithril-template'","symbol":"mithrilTemplate","correct":"var mithrilTemplate = require('mithril-template')"},{"note":"No named exports in v0.0.1; only default export is a function. This is a placeholder.","wrong":"import { compile } from 'mithril-template'","symbol":"mithrilTemplate (named no default)","correct":"const { compile } = require('mithril-template')"},{"note":"Not distributed as standalone script; only Node require() pattern works.","wrong":"import mithrilTemplate from 'mithril-template'","symbol":"Global usage","correct":"<script src='mithril-template.js'></script>"}],"quickstart":{"code":"var mithrilTemplate = require('mithril-template');\nvar hyperscript = mithrilTemplate('<h1 class=\"greetings\">Hello {{ name }}!</h1>');\nconsole.log(hyperscript); // m('.greetings','Hello '+name+'!')","lang":"javascript","description":"Converts an HTML template string with interpolation to Mithril hyperscript function call."},"warnings":[{"fix":"Use require() instead of import.","message":"No ES module support; only CommonJS require() works.","severity":"breaking","affected_versions":"0.0.1"},{"fix":"Write <custom-component></custom-component> not <custom-component />.","message":"Component tags must end with '-component' and cannot be self-closing.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Use binding attribute syntax with colon, e.g., :key=\"foo\" instead of key=\"{{ foo }}\".","message":"Mustache interpolation {} cannot be used inside HTML tag definitions.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Use {{ '{' }} and {{ '}'+'}' }} or similar string concatenation.","message":"Literal { and } characters in templates must be escaped using interpolation workaround.","severity":"gotcha","affected_versions":"0.0.1"},{"fix":"Consider alternatives like mithril-node-render or custom source transform.","message":"Package is unmaintained; no updates since initial release.","severity":"deprecated","affected_versions":"0.0.1"},{"fix":"Prefix data-bound attributes with colon: <custom-component :class=\"'custom-class'\"></custom-component>.","message":"HTML attributes not prefixed with colon are omitted when used on component tags.","severity":"gotcha","affected_versions":"0.0.1"}],"env_vars":null,"last_verified":"2026-05-01T00:00:00.000Z","next_check":"2026-07-30T00:00:00.000Z","problems":[{"fix":"Run 'npm install mithril-template' and use require('mithril-template').","cause":"Package not installed or import path wrong.","error":"Cannot find module 'mithril-template'"},{"fix":"Use const mithrilTemplate = require('mithril-template') instead of import.","cause":"Attempted ES import on CommonJS module.","error":"Unexpected token 'export'"},{"fix":"The default export is the compile function. Use const compile = require('mithril-template').","cause":"Assuming named export instead of default.","error":"Compile is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}