{"id":13816192,"url":"https://github.com/stevenvachon/handlebars-react","last_synced_at":"2025-04-11T23:01:41.256Z","repository":{"id":25512255,"uuid":"28943904","full_name":"stevenvachon/handlebars-react","owner":"stevenvachon","description":"Compile Handlebars templates to React.","archived":false,"fork":false,"pushed_at":"2016-02-28T06:52:07.000Z","size":31,"stargazers_count":123,"open_issues_count":2,"forks_count":8,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-10-15T01:01:18.188Z","etag":null,"topics":["handlebars","handlebars-html-parser","nodejs","react","vdom"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/stevenvachon.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-08T02:00:41.000Z","updated_at":"2024-06-19T19:45:49.000Z","dependencies_parsed_at":"2022-08-25T06:00:55.304Z","dependency_job_id":null,"html_url":"https://github.com/stevenvachon/handlebars-react","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fhandlebars-react","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fhandlebars-react/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fhandlebars-react/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stevenvachon%2Fhandlebars-react/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stevenvachon","download_url":"https://codeload.github.com/stevenvachon/handlebars-react/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248492875,"owners_count":21113162,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["handlebars","handlebars-html-parser","nodejs","react","vdom"],"created_at":"2024-08-04T05:00:37.026Z","updated_at":"2025-04-11T23:01:41.227Z","avatar_url":"https://github.com/stevenvachon.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"# handlebars-react [![NPM Version][npm-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Dependency Status][david-image]][david-url]\n\n\u003e Compile Handlebars templates to [React](https://facebook.github.io/react/).\n\nCompile this:\n```handlebars\n\u003cdiv\u003e\n\ttext1\n\t{{variable1}}\n\t{{#if variable2}}\u003cspan\u003etext2\u003c/span\u003e{{else}}text3{{/if}}\n\t\u003cspan data-attr=\"{{#if variable3}}value1{{/if}} value2\"\u003etext4\u003c/span\u003e\n\u003c/div\u003e\n```\ninto this:\n```js\nReact.DOM.div(null,\n\t\"text1\",\n\tthis.props.variable1,\n\tthis.props.variable2 ? React.DOM.span(null,\n\t\t\"text2\"\n\t) : \"text3\",\n\tReact.DOM.span({\"data-attr\":(this.props.variable3 ? \"value1\" : \"\") + \" value2\"},\n\t\t\"text4\"\n\t)\n);\n```\n\n\n## Installation\n[Node.js](http://nodejs.org/) `\u003e= 5` is required; `\u003c 5.0` will need an ES6 compiler. ~~Type this at the command line:~~\n```shell\nnpm install handlebars-react\n```\n\n\n## Usage\n\n### Server/Browserify\n```js\nvar HandlebarsReact = require(\"handlebars-react\");\n\nnew HandlebarsReact(options)\n.compile(\"\u003ch1\u003e{{title}}\u003c/h1\u003e\")\n.then(result =\u003e console.log(\"done!\"));\n```\n\n### UMD/AMD/etc\nAccessible via `define()` or `window.HandlebarsReact`.\n\n\n## Options\n\n### options.beautify\nType: `Boolean`  \nDefault value: `false`  \nWhen `true`, output will be formatted for increased legibility.\n\n### options.env\nType: `String`  \nDefault value: `undefined`  \n[Option presets](https://github.com/stevenvachon/handlebars-react/blob/master/lib/parseOptions.js) for your target environment: `\"development\"` or `\"production\"`. Preset options can be overridden.\n\n### options.normalizeWhitespace\nType: `Boolean`  \nDefault value: `false`  \nSee [handlebars-html-parser](https://github.com/stevenvachon/handlebars-html-parser).\n\n### options.processCSS\nType: `Boolean`  \nDefault value: `false`  \nSee [handlebars-html-parser](https://github.com/stevenvachon/handlebars-html-parser).\n\n### options.processJS\nType: `Boolean`  \nDefault value: `false`  \nSee [handlebars-html-parser](https://github.com/stevenvachon/handlebars-html-parser).\n\n### options.useDomMethods\nType: `Boolean`  \nDefault value: `false`  \nWhen `true`, available `React.DOM` convenience functions will be used instead of `React.createElement()`.\n\n\n## Roadmap Features\n* `convertHbsComments` to JavaScript block comments (or HTML comments?)\n* `convertHtmlComments` to JavaScript block comments\n* `ignoreComments` option when React supports such ([react#2810](https://github.com/facebook/react/issues/2810))\n* `trimWhitespace` option to remove spaces between elements (`\u003ctag\u003e a word \u003ctag\u003e` to `\u003ctag\u003ea word\u003ctag\u003e`)?\n\n\n## Changelog\n* 0.0.1–0.0.16 pre-releases\n\n\n[npm-image]: https://img.shields.io/npm/v/handlebars-react.svg\n[npm-url]: https://npmjs.org/package/handlebars-react\n[travis-image]: https://img.shields.io/travis/stevenvachon/handlebars-react.svg\n[travis-url]: https://travis-ci.org/stevenvachon/handlebars-react\n[david-image]: https://img.shields.io/david/stevenvachon/handlebars-react.svg\n[david-url]: https://david-dm.org/stevenvachon/handlebars-react\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fhandlebars-react","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstevenvachon%2Fhandlebars-react","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstevenvachon%2Fhandlebars-react/lists"}