Registry / coz-bud-compiler

coz-bud-compiler

JSON →
library3.0.4jsnpmunverified

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.

npm install coz-bud-compiler
INSTALL
IMPORT
SIG · COZ-BUD-COMPILER
C
coz-bud-compiler
javascriptv3.0.4
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
import cozBudCompiler from 'coz-bud-compiler'
const cozBudCompiler = require('coz-bud-compiler')
ESM default export since v3
compile
import { compile } from 'coz-bud-compiler'
Named export for compile function
createCompiler
import { createCompiler } from 'coz-bud-compiler'
import { Compiler } from 'coz-bud-compiler'
Use createCompiler factory function, not a class

Demonstrates creating a compiler with resolvers and compiling a bud.

import cozBudCompiler from 'coz-bud-compiler' const compiler = cozBudCompiler({ resolveTmpl: (filename) => `./templates/${filename}.hbs`, resolveEngine: (name) => require(`engine-${name}`) }) async function build() { const bud = { mode: 'render', path: './output/file.txt', data: { name: 'example' }, tmpl: 'my-template' } const compiled = await compiler.compile(bud) console.log(compiled) } build().catch(console.error)
Debug
Known issues
breakingcoz-bud-compiler@3 drops support for Node <8, requires async/await for compile method
fix
Ensure Node >=8 and use async/await or promises with compile
affects: >=3.0.0
deprecatedThe old-style synchronous compile method or callback-based API is removed in v3
fix
Use the async compile method or promise chain
affects: >=3.0.0
gotchaThe resolveTmpl and resolveEngine callbacks must return strings or modules, not promises (though they can be async)
fix
Ensure these callbacks are synchronous or return a Promise if needed
affects: >=3.0.0
Errors
Common errors & fixes
TypeError: cozBudCompiler is not a function
Missing default import or incorrect require
fix
Use correct import: import cozBudCompiler from 'coz-bud-compiler'
Cannot find module 'engine-handlebars'
resolveEngine returns a module that is not installed
fix
Install the required engine package or provide correct path
Bud must have a 'tmpl' property
Bud object missing required field tmpl
fix
Ensure bud.tmpl is defined
Upgrade
Version history
3.0.4latest on npm
Audit
Dependencies
coz-budrequiredCore dependency for bud definitions
coz-tmploptionalTemplate resolution support
Agent activity
4 hits · last 30 days
node
4
Resources
coz-bud-compiler — npm install coz-bud-compiler · libregistry