Handlebars templates compiler and bundler that compiles static templates with JSON or YAML data and precompiles templates into AMD/Node/ES6/JST wrappers. Version 1.2.0 is the current stable release. Release cadence is low, with no recent updates. Key differentiators include a Promise-based API, CLI with Unix pipe support, and an integrated Grunt task, unlike standalone Handlebars or other precompilers that lack bundling or pipe capabilities. It supports both compilation to HTML and precompilation for SPA delivery.
npm install bundlebarsVerified import paths — ran on the pinned version, not inferred.
Shows how to use compile and precompile functions with bundlebars. The compile function takes template string and data object, returns a Promise with rendered string. The precompile function takes template string and options object (e.g., wrapper: 'amd'), returns a Promise with precompiled template string.
Use the CLI or read the file with fs.readFileSync and pass the content string.
No immediate fix needed, but consider using a newer library or manually overriding with native promises.
Use an absolute path or ensure the relative path is correct from the working directory.
Run npm install q --save or ensure bundlebars is installed properly (npm install bundlebars).
Use proper import: import { compile } from 'bundlebars' or const { compile } = require('bundlebars').Run npm install js-yaml --save if you need YAML support.