handlebars-lang/handlebars.js ? reverse-engineered prompt
Reverse engineered prompt
Build me a small but solid JavaScript templating library like Mustache, but with the extra Handlebars style features people expect. I want to write templates with double braces, compile them into render functions, and pass in plain data objects to get HTML or text back. It should handle nested values, arrays, partial templates, custom helpers, block style helpers, literal values, and template comments, while staying mostly compatible with basic Mustache templates.
Please also include a way to precompile templates into JavaScript for faster startup, plus a lightweight runtime for using those precompiled templates in apps. It should work in modern Node and modern browsers.
Make the project feel production ready, with clear docs and examples, sensible error messages, tests for the core behavior, and basic type definitions so editors can understand the public API. If there are known differences from Mustache, call those out clearly. Look up the current Handlebars docs online if you need to match expected behavior.
Are you gonna build this?
make sure you review the code using coderabbit