[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-3227":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":16,"stars7d":17,"stars30d":18,"stars90d":16,"forks30d":16,"starsTrendScore":16,"compositeScore":19,"rankGlobal":10,"rankLanguage":10,"license":20,"archived":21,"fork":21,"defaultBranch":22,"hasWiki":21,"hasPages":21,"topics":23,"createdAt":10,"pushedAt":10,"updatedAt":27,"readmeContent":28,"aiSummary":29,"trendingCount":16,"starSnapshotCount":16,"syncStatus":17,"lastSyncTime":30,"discoverSource":31},3227,"handlebars.js","handlebars-lang\u002Fhandlebars.js","handlebars-lang","Minimal templating on steroids.","http:\u002F\u002Fhandlebarsjs.com",null,"JavaScript",18638,2055,432,79,0,2,19,44.94,"MIT License",false,"master",[24,25,26],"handlebars","mustache","templates","2026-06-12 02:00:47","[![CI Build Status](https:\u002F\u002Fgithub.com\u002Fhandlebars-lang\u002Fhandlebars.js\u002Factions\u002Fworkflows\u002Fci.yml\u002Fbadge.svg)](https:\u002F\u002Fgithub.com\u002Fhandlebars-lang\u002Fhandlebars.js\u002Factions\u002Fworkflows\u002Fci.yml)\n[![jsDelivr Hits](https:\u002F\u002Fdata.jsdelivr.com\u002Fv1\u002Fpackage\u002Fnpm\u002Fhandlebars\u002Fbadge?style=rounded)](https:\u002F\u002Fwww.jsdelivr.com\u002Fpackage\u002Fnpm\u002Fhandlebars)\n[![npm downloads](https:\u002F\u002Fbadgen.net\u002Fnpm\u002Fdm\u002Fhandlebars)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fhandlebars)\n[![npm version](https:\u002F\u002Fbadgen.net\u002Fnpm\u002Fv\u002Fhandlebars)](https:\u002F\u002Fwww.npmjs.com\u002Fpackage\u002Fhandlebars)\n[![Bundle size](https:\u002F\u002Fbadgen.net\u002Fbundlephobia\u002Fminzip\u002Fhandlebars?label=minified%20%2B%20gzipped)](https:\u002F\u002Fbundlephobia.com\u002Fpackage\u002Fhandlebars)\n[![Install size](https:\u002F\u002Fpackagephobia.com\u002Fbadge?p=handlebars)](https:\u002F\u002Fpackagephobia.com\u002Fresult?p=handlebars)\n\n# Handlebars.js\n\nHandlebars provides the power necessary to let you build **semantic templates** effectively with no frustration.\nHandlebars is largely compatible with Mustache templates. In most cases it is possible to swap out Mustache with Handlebars and continue using your current templates.\n\nCheckout the official Handlebars docs site at\n[handlebarsjs.com](https:\u002F\u002Fhandlebarsjs.com) and try our [live demo](https:\u002F\u002Fhandlebarsjs.com\u002Fplayground.html).\n\n## Installing\n\nSee our [installation documentation](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002Finstallation\u002F).\n\n## Usage\n\nIn general, the syntax of Handlebars.js templates is a superset\nof Mustache templates. For basic syntax, check out the [Mustache\nmanpage](https:\u002F\u002Fmustache.github.io\u002Fmustache.5.html).\n\nOnce you have a template, use the `Handlebars.compile` method to compile\nthe template into a function. The generated function takes a context\nargument, which will be used to render the template.\n\n```js\nvar source =\n  '\u003Cp>Hello, my name is {{name}}. I am from {{hometown}}. I have ' +\n  '{{kids.length}} kids:\u003C\u002Fp>' +\n  '\u003Cul>{{#kids}}\u003Cli>{{name}} is {{age}}\u003C\u002Fli>{{\u002Fkids}}\u003C\u002Ful>';\nvar template = Handlebars.compile(source);\n\nvar data = {\n  name: 'Alan',\n  hometown: 'Somewhere, TX',\n  kids: [\n    { name: 'Jimmy', age: '12' },\n    { name: 'Sally', age: '4' },\n  ],\n};\nvar result = template(data);\n\n\u002F\u002F Would render:\n\u002F\u002F \u003Cp>Hello, my name is Alan. I am from Somewhere, TX. I have 2 kids:\u003C\u002Fp>\n\u002F\u002F \u003Cul>\n\u002F\u002F   \u003Cli>Jimmy is 12\u003C\u002Fli>\n\u002F\u002F   \u003Cli>Sally is 4\u003C\u002Fli>\n\u002F\u002F \u003C\u002Ful>\n```\n\nFull documentation and more examples are at [handlebarsjs.com](https:\u002F\u002Fhandlebarsjs.com\u002F).\n\n## Precompiling Templates\n\nHandlebars allows templates to be precompiled and included as javascript code rather than the handlebars template allowing for faster startup time. Full details are located [here](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002Finstallation\u002Fprecompilation.html).\n\n## Differences Between Handlebars.js and Mustache\n\nHandlebars.js adds a couple of additional features to make writing\ntemplates easier and also changes a tiny detail of how partials work.\n\n- [Nested Paths](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002Fexpressions.html#path-expressions)\n- [Helpers](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002Fexpressions.html#helpers)\n- [Block Expressions](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002Fblock-helpers.html#basic-blocks)\n- [Literal Values](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002Fexpressions.html#literal-segments)\n- [Delimited Comments](https:\u002F\u002Fhandlebarsjs.com\u002Fguide\u002F#template-comments)\n\nBlock expressions have the same syntax as mustache sections but should not be confused with one another. Sections are akin to an implicit `each` or `with` statement depending on the input data and helpers are explicit pieces of code that are free to implement whatever behavior they like. The [mustache spec](https:\u002F\u002Fmustache.github.io\u002Fmustache.5.html) defines the exact behavior of sections. In the case of name conflicts, helpers are given priority.\n\n### Compatibility\n\nThere are a few Mustache behaviors that Handlebars does not implement.\n\n- Handlebars deviates from Mustache slightly in that it does not perform recursive lookup by default. The compile time `compat` flag must be set to enable this functionality. Users should note that there is a performance cost for enabling this flag. The exact cost varies by template, but it's recommended that performance sensitive operations should avoid this mode and instead opt for explicit path references.\n- The optional Mustache-style lambdas are not supported. Instead Handlebars provides its own lambda resolution that follows the behaviors of helpers.\n- Handlebars does not allow space between the opening `{{` and a command character such as `#`, `\u002F` or `>`. The command character must immediately follow the braces, so for example `{{> partial }}` is allowed but `{{ > partial }}` is not.\n- Alternative delimiters are not supported.\n\n## Supported Environments\n\nHandlebars has been designed to work in any ECMAScript 2020 environment. This includes\n\n- Node.js\n- Chrome\n- Firefox\n- Safari\n- Edge\n\nIf you need to support older environments, use Handlebars version 4.\n\n## Performance\n\nIn a rough performance test, precompiled Handlebars.js templates (in\nthe original version of Handlebars.js) rendered in about half the\ntime of Mustache templates. It would be a shame if it were any other\nway, since they were precompiled, but the difference in architecture\ndoes have some big performance advantages. Justin Marney, a.k.a.\n[gotascii](http:\u002F\u002Fgithub.com\u002Fgotascii), confirmed that with an\n[independent test](http:\u002F\u002Fsorescode.com\u002F2010\u002F09\u002F12\u002Fbenchmarks.html). The\nrewritten Handlebars (current version) is faster than the old version,\nwith many performance tests being 5 to 7 times faster than the Mustache equivalent.\n\n### Benchmarks\n\nThe project includes a comprehensive benchmark suite (powered by [tinybench](https:\u002F\u002Fgithub.com\u002Ftinylibs\u002Ftinybench)) that measures compilation, execution, precompilation, and end-to-end performance across templates of varying size and complexity.\n\n```bash\n# Run benchmarks (auto-labels with current git branch)\nnpm run bench\n\n# Run with a custom label\nnpm run bench -- --label my-optimization\n\n# Filter templates by name (regex, case-insensitive)\nnpm run bench -- --grep \"complex|recursive\"\n\n# Run only specific sections (regex, case-insensitive)\nnpm run bench -- --section precompil\nnpm run bench -- --section \"compilation|precompil\"\n\n# Compare results\nnpm run bench:compare\n\n# Or specify files explicitly\nnpm run bench:compare -- bench\u002Fresults\u002Fbench-*-main.md bench\u002Fresults\u002Fbench-*-feat.md\n```\n\nResults are saved as timestamped Markdown files in `bench\u002Fresults\u002F`. Each report includes ops\u002Fsec, avg latency, p50\u002Fp75\u002Fp99 percentiles, and sample counts.\n\nTypical workflow for comparing branches:\n\n```bash\ngit checkout main && npm run bench\ngit checkout my-feature && npm run bench\nnpm run bench:compare\n```\n\nWhen run without arguments, `bench:compare` auto-selects two result files: if a file labelled \"main\" exists it is always used as the baseline, otherwise the older file is the baseline. The comparison uses p75 latency for the diff to filter outliers, and marks changes with `!` (>2%) and `!!` (>5%).\n\n## Upgrading\n\nSee [release-notes.md](https:\u002F\u002Fgithub.com\u002Fhandlebars-lang\u002Fhandlebars.js\u002Fblob\u002Fmaster\u002Frelease-notes.md) for upgrade notes.\n\nIf you are using Handlebars in production, please regularly look for issues labeled\n[possibly breaking](https:\u002F\u002Fgithub.com\u002Fhandlebars-lang\u002Fhandlebars.js\u002Fissues?q=is%3Aopen+is%3Aissue+label%3A%22possibly+breaking%22).\nIf this label is applied to an issue, it means that the requested change is probably not a breaking change,\nbut since Handlebars is widely in use by a lot of people, there's always a chance that it breaks somebody's build.\n\n## Known Issues\n\nSee [FAQ.md](https:\u002F\u002Fgithub.com\u002Fhandlebars-lang\u002Fhandlebars.js\u002Fblob\u002Fmaster\u002FFAQ.md) for known issues and common pitfalls.\n\n## Handlebars in the Wild\n\n- [apiDoc](https:\u002F\u002Fgithub.com\u002Fapidoc\u002Fapidoc) apiDoc uses handlebars as parsing engine for api documentation view generation.\n- [Assemble](https:\u002F\u002Fassemble.io), by [@jonschlinkert](https:\u002F\u002Fgithub.com\u002Fjonschlinkert) and [@doowb](https:\u002F\u002Fgithub.com\u002Fdoowb), is a static site generator that uses Handlebars.js as its template engine.\n- [CoSchedule](https:\u002F\u002Fcoschedule.com) An editorial calendar for WordPress that uses Handlebars.js.\n- [Ember.js](https:\u002F\u002Fwww.emberjs.com) makes Handlebars.js the primary way to structure your views, also with automatic data binding support.\n- [express-handlebars](https:\u002F\u002Fgithub.com\u002Fexpress-handlebars\u002Fexpress-handlebars) A Handlebars view engine for Express which doesn't suck.\n- [express-hbs](https:\u002F\u002Fgithub.com\u002FTryGhost\u002Fexpress-hbs) Express Handlebars template engine with inheritance, partials, i18n and async helpers.\n- [Ghost](https:\u002F\u002Fghost.org\u002F) Just a blogging platform.\n- [handlebars-action](https:\u002F\u002Fgithub.com\u002Fmarketplace\u002Factions\u002Fhandlebars-action) A GitHub action to transform files in your repository with Handlebars templating.\n- [handlebars_assets](https:\u002F\u002Fgithub.com\u002Fleshill\u002Fhandlebars_assets) A Rails Asset Pipeline gem from Les Hill (@leshill).\n- [handlebars-helpers](https:\u002F\u002Fgithub.com\u002Fassemble\u002Fhandlebars-helpers) is an extensive library with 100+ handlebars helpers.\n- [handlebars-layouts](https:\u002F\u002Fgithub.com\u002Fshannonmoeller\u002Fhandlebars-layouts) is a set of helpers which implement extensible and embeddable layout blocks as seen in other popular templating languages.\n- [handlebars-loader](https:\u002F\u002Fgithub.com\u002Fpcardune\u002Fhandlebars-loader) A handlebars template loader for webpack.\n- [handlebars-wax](https:\u002F\u002Fgithub.com\u002Fshannonmoeller\u002Fhandlebars-wax) The missing Handlebars API. Effortless registration of data, partials, helpers, and decorators using file-system globs, modules, and plain-old JavaScript objects.\n- [hbs](https:\u002F\u002Fgithub.com\u002Fpillarjs\u002Fhbs) An Express.js view engine adapter for Handlebars.js, from Don Park.\n- [html-bundler-webpack-plugin](https:\u002F\u002Fgithub.com\u002Fwebdiscus\u002Fhtml-bundler-webpack-plugin) The webpack plugin to compile templates, [supports Handlebars](https:\u002F\u002Fgithub.com\u002Fwebdiscus\u002Fhtml-bundler-webpack-plugin#using-template-handlebars).\n- [incremental-bars](https:\u002F\u002Fgithub.com\u002Fatomictag\u002Fincremental-bars) adds support for [incremental-dom](https:\u002F\u002Fgithub.com\u002Fgoogle\u002Fincremental-dom) as template target to Handlebars.\n- [jQuery plugin](https:\u002F\u002F71104.github.io\u002Fjquery-handlebars\u002F) allows you to use Handlebars.js with [jQuery](http:\u002F\u002Fjquery.com\u002F).\n- [just-handlebars-helpers](https:\u002F\u002Fgithub.com\u002Fleapfrogtechnology\u002Fjust-handlebars-helpers) A fully tested lightweight package with common Handlebars helpers.\n- [koa-hbs](https:\u002F\u002Fgithub.com\u002Fjwilm\u002Fkoa-hbs) [koa](https:\u002F\u002Fgithub.com\u002Fkoajs\u002Fkoa) generator based renderer for Handlebars.js.\n- [Marionette.Handlebars](https:\u002F\u002Fgithub.com\u002Fhashchange\u002Fmarionette.handlebars) adds support for Handlebars and Mustache templates to Marionette.\n- [openVALIDATION](https:\u002F\u002Fgithub.com\u002Fopenvalidation\u002Fopenvalidation) a natural language compiler for validation rules. Generates program code in Java, JavaScript, C#, Python and Rust with handlebars.\n- [Plop](https:\u002F\u002Fplopjs.com\u002F) is a micro-generator framework that makes it easy to create files with a level of uniformity.\n- [promised-handlebars](https:\u002F\u002Fgithub.com\u002Fnknapp\u002Fpromised-handlebars) is a wrapper for Handlebars that allows helpers to return Promises.\n- [sammy.js](https:\u002F\u002Fgithub.com\u002Fquirkey\u002Fsammy) by Aaron Quint, a.k.a. quirkey, supports Handlebars.js as one of its template plugins.\n- [Swag](https:\u002F\u002Fgithub.com\u002Felving\u002Fswag) by [@elving](https:\u002F\u002Fgithub.com\u002Felving) is a growing collection of helpers for handlebars.js. Give your handlebars.js templates some swag son!\n- [SproutCore](https:\u002F\u002Fwww.sproutcore.com) uses Handlebars.js as its main templating engine, extending it with automatic data binding support.\n- [vite-plugin-handlebars](https:\u002F\u002Fgithub.com\u002Falexlafroscia\u002Fvite-plugin-handlebars) A package for Vite 2. Allows for running your HTML files through the Handlebars compiler.\n- [YUI](https:\u002F\u002Fyuilibrary.com\u002Fyui\u002Fdocs\u002Fhandlebars\u002F) implements a port of handlebars.\n\n## External Resources\n\n- [Gist about Synchronous and asynchronous loading of external handlebars templates](https:\u002F\u002Fgist.github.com\u002F2287070)\n\nHave a project using Handlebars? Send us a [pull request][pull-request]!\n\n## License\n\nHandlebars.js is released under the MIT license.\n\n[pull-request]: https:\u002F\u002Fgithub.com\u002Fhandlebars-lang\u002Fhandlebars.js\u002Fpull\u002Fnew\u002Fmaster\n","Handlebars.js 是一个用于构建语义模板的强大工具。它支持Mustache模板语法，并在此基础上提供了更多的功能，如嵌套路径、辅助函数以及块表达式等，使得模板编写更加灵活高效。此外，Handlebars.js还支持预编译模板为JavaScript代码，从而加快应用启动速度。由于其轻量级且易于集成的特点，Handlebars.js非常适合于需要客户端渲染的Web应用程序或任何需要动态生成HTML内容的场景中使用。","2026-06-11 02:52:59","top_language"]