{"id":19226003,"url":"https://github.com/developer239/vite-react-wasm-cpp-emscripten-cmake","last_synced_at":"2026-04-13T03:04:06.222Z","repository":{"id":166165406,"uuid":"641516287","full_name":"developer239/vite-react-wasm-cpp-emscripten-cmake","owner":"developer239","description":"TypeScript \u0026 React boilerplate with C++ WASM module for native features or performance boost.","archived":false,"fork":false,"pushed_at":"2023-05-16T21:22:52.000Z","size":178,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-06-13T05:44:02.082Z","etag":null,"topics":["cmake","cpp","emscripten","javascript","react","typescript","vite","wasm"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/developer239.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-05-16T16:23:42.000Z","updated_at":"2025-02-19T06:21:05.000Z","dependencies_parsed_at":null,"dependency_job_id":"76fc51a3-ddfd-4d30-93ef-49ea1f9f1552","html_url":"https://github.com/developer239/vite-react-wasm-cpp-emscripten-cmake","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/developer239/vite-react-wasm-cpp-emscripten-cmake","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fvite-react-wasm-cpp-emscripten-cmake","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fvite-react-wasm-cpp-emscripten-cmake/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fvite-react-wasm-cpp-emscripten-cmake/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fvite-react-wasm-cpp-emscripten-cmake/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/developer239","download_url":"https://codeload.github.com/developer239/vite-react-wasm-cpp-emscripten-cmake/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/developer239%2Fvite-react-wasm-cpp-emscripten-cmake/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266572293,"owners_count":23949992,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"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":["cmake","cpp","emscripten","javascript","react","typescript","vite","wasm"],"created_at":"2024-11-09T15:17:02.273Z","updated_at":"2026-04-13T03:04:01.192Z","avatar_url":"https://github.com/developer239.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Vite React WASM CPP Emscripten\n\nTypeScript \u0026 React boilerplate with C++ WASM module for native features or performance boost.\n\n## Installation\n\n- `yarn install` (install Node dependencies)\n- `npm run install:emsdk` (initialize [emsdk](https://github.com/emscripten-core/emsdk))\n- `npm run build:wasm` (build WASM module and JavaScript glue file)\n\n## Development\n\n- `npm run dev` (start development server)\n- `npm run build:wasm` (rebuild WASM if C++ changes)\n\n## Project Structure\n\n- `src` - TypeScript \u0026 React source code\n- `cpp/src` - C++ source code\n\n```text\n├── src\n│   ├── App.tsx\n│   ├── index.css\n│   ├── main.tsx\n│   ├── vite-env.d.ts\n│   └── wasm.d.ts\n└── cpp\n    └── main.cpp\n```\n\n## Useful Commands\n\n- `npm run lint:ts` lint TS files\n- `npm run format` format files\n- `npm run prepare:husky` install git hooks\n\n## Example\n\n```cpp\n// cpp/src/main.cpp\n\n#include \u003cemscripten/bind.h\u003e\n\nstd::string hello() {\n  return \"Hello from C++!\";\n}\n\nEMSCRIPTEN_BINDINGS(wasm_module) {\n  emscripten::function(\"hello\", \u0026hello);\n}\n```\n\nDefine types for the glue code:\n\n```ts\n// src/wasm.d.ts\n\ndeclare let Module: {\n  hello: () =\u003e string\n}\n```\n\nUse global module in your app:\n\n```ts\nexport const App = () =\u003e \u003cdiv\u003e{Module.hello()}\u003c/div\u003e\n```\n\nThe wasm module is loaded in `indx.html`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper239%2Fvite-react-wasm-cpp-emscripten-cmake","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeveloper239%2Fvite-react-wasm-cpp-emscripten-cmake","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeveloper239%2Fvite-react-wasm-cpp-emscripten-cmake/lists"}