{"id":17930762,"url":"https://github.com/lovasoa/musreact","last_synced_at":"2026-03-01T15:33:20.264Z","repository":{"id":24497390,"uuid":"27902539","full_name":"lovasoa/musreact","owner":"lovasoa","description":"Mustache template to react component compiler","archived":false,"fork":false,"pushed_at":"2016-03-24T09:57:15.000Z","size":269,"stargazers_count":13,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T20:45:58.015Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://lovasoa.github.io/musreact/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lovasoa.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":"2014-12-12T02:51:40.000Z","updated_at":"2025-02-25T19:42:38.000Z","dependencies_parsed_at":"2022-08-22T23:40:37.580Z","dependency_job_id":null,"html_url":"https://github.com/lovasoa/musreact","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lovasoa/musreact","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmusreact","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmusreact/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmusreact/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmusreact/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lovasoa","download_url":"https://codeload.github.com/lovasoa/musreact/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lovasoa%2Fmusreact/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29973317,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T15:29:09.406Z","status":"ssl_error","status_checked_at":"2026-03-01T15:28:28.558Z","response_time":124,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":[],"created_at":"2024-10-28T21:15:46.637Z","updated_at":"2026-03-01T15:33:20.228Z","avatar_url":"https://github.com/lovasoa.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"musreact\n========\n\nMustache template to react component compiler\n\n## Demo\nhttp://lovasoa.github.io/musreact/\n\n## How to use\n\n### Directly in html\nCompile the mustache template on the client.\n\n```html\n\u003cscript scr=\"http://lovasoa.github.io/musreact/js/musreact.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"http://facebook.github.io/react/js/react.js\"\u003e\u003c/script\u003e\n\n\u003c!-- The react component will be mounted here --\u003e\n\u003cdiv id=\"mountpoint\"\u003e\u003c/div\u003e\n\n\u003cscript\u003e\nvar mustacheStr = \"\u003cp\u003eYour name is \u003cem\u003e{{name}}\u003c/em\u003e\u003c/p\u003e\";\nvar jsondata    = {name: \"Gérard Bouchard\"};\n\nvar source = parser.parse(mustacheStr);\n\n// Create a react component\nvar reactComponent = eval(source);\n\n// Use it\nReact.render(\n    React.createElement(reactComponent, jsondata),\n    document.getElementById(\"mountpoint\")\n);\n\u003c/script\u003e\n```\n\n### Server compiling\nJust save the output of `parser.parse(mustacheString)`, and serve it as a normal js file.\n\nAn simple script could be:\n```js\nvar fs = require(\"fs\");\nvar parse = require(\"musreact\").parse;\n\nvar jsSource = parse(fs.readFileSync(\"react-component.mustache\", \"utf-8\"));\n\nfs.writeFileSync(\"react-component.js\", \"MyComponent = \" + jsSource);\n```\n\nIt reads the template from `react-component.mustache` and saves the compiled\nreact component to `react-component.js`. The component will then be accessible through\nthe global variable `MyComponent`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasoa%2Fmusreact","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flovasoa%2Fmusreact","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flovasoa%2Fmusreact/lists"}