{"id":25132,"library":"coz-bud-compiler","title":"coz-bud-compiler","description":"coz-bud-compiler is a plugin for the coz build system that compiles coz bud definitions into rendering instructions. Version 3.0.4 is the latest stable release, supporting Node >=8 and npm >=5. It provides a compiler object that processes bud configurations and returns compiled buds. Compared to other build tools, it specializes in the coz ecosystem and relies on external template resolvers and engine resolvers. The package is relatively niche and has a limited maintenance history.","status":"active","version":"3.0.4","language":"javascript","source_language":"en","source_url":"https://github.com/coz-labo/coz-bud-compiler","tags":["javascript","coz","bud","compiler"],"install":[{"cmd":"npm install coz-bud-compiler","lang":"bash","label":"npm"},{"cmd":"yarn add coz-bud-compiler","lang":"bash","label":"yarn"},{"cmd":"pnpm add coz-bud-compiler","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Core dependency for bud definitions","package":"coz-bud","optional":false},{"reason":"Template resolution support","package":"coz-tmpl","optional":true}],"imports":[{"note":"ESM default export since v3","wrong":"const cozBudCompiler = require('coz-bud-compiler')","symbol":"default","correct":"import cozBudCompiler from 'coz-bud-compiler'"},{"note":"Named export for compile function","wrong":"","symbol":"compile","correct":"import { compile } from 'coz-bud-compiler'"},{"note":"Use createCompiler factory function, not a class","wrong":"import { Compiler } from 'coz-bud-compiler'","symbol":"createCompiler","correct":"import { createCompiler } from 'coz-bud-compiler'"}],"quickstart":{"code":"import cozBudCompiler from 'coz-bud-compiler'\n\nconst compiler = cozBudCompiler({\n  resolveTmpl: (filename) => `./templates/${filename}.hbs`,\n  resolveEngine: (name) => require(`engine-${name}`)\n})\n\nasync function build() {\n  const bud = {\n    mode: 'render',\n    path: './output/file.txt',\n    data: { name: 'example' },\n    tmpl: 'my-template'\n  }\n  const compiled = await compiler.compile(bud)\n  console.log(compiled)\n}\n\nbuild().catch(console.error)","lang":"typescript","description":"Demonstrates creating a compiler with resolvers and compiling a bud."},"warnings":[{"fix":"Ensure Node >=8 and use async/await or promises with compile","message":"coz-bud-compiler@3 drops support for Node <8, requires async/await for compile method","severity":"breaking","affected_versions":">=3.0.0"},{"fix":"Use the async compile method or promise chain","message":"The old-style synchronous compile method or callback-based API is removed in v3","severity":"deprecated","affected_versions":">=3.0.0"},{"fix":"Ensure these callbacks are synchronous or return a Promise if needed","message":"The resolveTmpl and resolveEngine callbacks must return strings or modules, not promises (though they can be async)","severity":"gotcha","affected_versions":">=3.0.0"}],"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 cozBudCompiler from 'coz-bud-compiler'","cause":"Missing default import or incorrect require","error":"TypeError: cozBudCompiler is not a function"},{"fix":"Install the required engine package or provide correct path","cause":"resolveEngine returns a module that is not installed","error":"Cannot find module 'engine-handlebars'"},{"fix":"Ensure bud.tmpl is defined","cause":"Bud object missing required field tmpl","error":"Bud must have a 'tmpl' property"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}