{"id":26463,"library":"techhead-hogan","title":"techhead-hogan","description":"A fork of Twitter's Hogan.js Mustache compiler (v0.0.1), adding helpers, method call chaining, dot notation, shorthand section close tags, and piped helpers. Released as a pre-1.0 package with limited documentation and bug fixes for delimiter handling and partial context access. Differentiated from Hogan.js by extended functionality for method calls and helpers, but likely incompatible with standard Mustache specifications.","status":"active","version":"0.0.1","language":"javascript","source_language":"en","source_url":"https://github.com/techhead/hogan.js","tags":["javascript","mustache","template"],"install":[{"cmd":"npm install techhead-hogan","lang":"bash","label":"npm"},{"cmd":"yarn add techhead-hogan","lang":"bash","label":"yarn"},{"cmd":"pnpm add techhead-hogan","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; no CommonJS support declared.","wrong":"const hogan = require('techhead-hogan')","symbol":"default","correct":"import hogan from 'techhead-hogan'"},{"note":"compile is a method on the default export; named import may not work depending on export structure.","wrong":"import { compile } from 'techhead-hogan'; // fails if package uses default export only","symbol":"compile","correct":"const { compile } = await import('techhead-hogan');\nconst t = compile('{{name}}', { delimiters: '{{ }}' });"},{"note":"Render is a method on the compiled template object.","wrong":"require('techhead-hogan').compile(...).render(...); // CJS not supported","symbol":"render","correct":"const t = (await import('techhead-hogan')).default.compile('{{name}}');\nconst output = t.render({ name: 'World' });"}],"quickstart":{"code":"import hogan from 'techhead-hogan';\n\nconst template = 'Hello {{name}}!';\nconst compiled = hogan.compile(template);\nconst output = compiled.render({ name: 'World' });\nconsole.log(output); // Hello World!\n\n// With helpers\nconst t2 = hogan.compile(\"{{ names | join }}\", { fixMethodCalls: 1, enableHelpers: 1 });\nconst r2 = t2.render({\n  names: ['a', 'b'],\n  join: function(arr) { return arr.join(', '); }\n});\nconsole.log(r2); // a, b","lang":"javascript","description":"Compile and render a basic Mustache template, then demonstrates piped helper usage with join."},"warnings":[{"fix":"Pass { enableHelpers: 1, fixMethodCalls: 1 } to compile().","message":"Helpers require enableHelpers:1 and fixMethodCalls:1 options; otherwise they are ignored.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"When using shorthand close tags, specify custom delimiters, e.g., { delimiters: '{{ }}' } or '{ }'.","message":"Shorthand close tags (like {/}) depend on delimiter option { delimiters: '{ }' } and may not work with default delimiters.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Add fixMethodCalls:1 to compile options.","message":"Method call chaining via dot notation only works when fixMethodCalls option is enabled.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Test templates against standard Mustache spec; avoid using new features if cross-compatibility is required.","message":"This fork may break compatibility with standard Mustache implementations due to added features.","severity":"breaking","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":"Use correct import: import hogan from 'techhead-hogan'; then hogan.compile().","cause":"Default import used but package emits a default export object.","error":"TypeError: hogan.compile is not a function"},{"fix":"Use import statement or dynamic import: const hogan = await import('techhead-hogan').then(m => m.default);","cause":"Attempting CommonJS require in an ESM context.","error":"ReferenceError: require is not defined"},{"fix":"Compile with { enableHelpers: 1 }.","cause":"Helpers not enabled; enableHelpers option missing.","error":"Error: Piped helper 'join' not found"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}