{"id":16906521,"url":"https://github.com/rsms/js-wasmc","last_synced_at":"2025-09-11T04:36:01.296Z","repository":{"id":42966768,"uuid":"141982767","full_name":"rsms/js-wasmc","owner":"rsms","description":"Simplifies building of WebAssembly modules in C/C++ and JS","archived":false,"fork":false,"pushed_at":"2023-03-04T05:12:46.000Z","size":2655,"stargazers_count":57,"open_issues_count":3,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-03-15T21:17:05.570Z","etag":null,"topics":["wasm","webassembly"],"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/rsms.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-07-23T08:10:23.000Z","updated_at":"2024-10-20T19:13:13.000Z","dependencies_parsed_at":"2024-10-27T12:14:33.042Z","dependency_job_id":"252212fe-0ed0-4b07-a54a-8814dba2180d","html_url":"https://github.com/rsms/js-wasmc","commit_stats":{"total_commits":54,"total_committers":2,"mean_commits":27.0,"dds":"0.16666666666666663","last_synced_commit":"0166cc693f4b59dcdb04f2a521b22e819dc2e7da"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fjs-wasmc","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fjs-wasmc/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fjs-wasmc/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rsms%2Fjs-wasmc/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rsms","download_url":"https://codeload.github.com/rsms/js-wasmc/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243847881,"owners_count":20357460,"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":["wasm","webassembly"],"created_at":"2024-10-13T18:42:59.716Z","updated_at":"2025-03-17T07:30:35.196Z","avatar_url":"https://github.com/rsms.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wasmc\n\nSimplifies building of WebAssembly modules from C and C++\n\n- Handles compiling, linking and packaging of C and C++ WASM/JS projects\n- Zero dependencies -- portable single-file program\n- Includes `rollup` and `uglify` functionality, producing very small products\n\n\n## Usage\n\n```\nusage: wasmc [options] [\u003cdir\u003e]\nusage: wasmc [-C \u003cdir\u003e] -T\u003ctool\u003e [\u003ctool-arg\u003e ...]\noptions:\n  -debug, -g       Disable optimizations and include data for debuggers.\n  -watch, -w       Watch source files and rebuild as needed.\n  -config \u003cfile\u003e   Load config file from \u003cfile\u003e instead of \u003cdir\u003e/wasmc.js\n  -clean           Rebuild even when product and sources are up to date.\n  -quiet, -q       Do not print information to stdout except for warnings and errors\n  -help, -h        Show help message and exit\n  -C \u003cdir\u003e         Change working directory; as if wasmc was invoked from \u003cdir\u003e.\n  -T\u003ctool\u003e         Run \u003ctool\u003e instead of building. -T for list of tools.\n\n\u003cdir\u003e\n  The module directory. Defaults to \".\" (dirname(\u003cfile\u003e) with -config)\n\n```\n\n\n### Example\n\n\u003e See the [`example`](examples/example/) directory for a complete example.\n\nInput `foo.c`:\n\n```c\n#include \u003cstdio.h\u003e\nexport void hello() {\n  printf(\"Hello from wasm\\n\");\n}\n```\n\nInput `foo.js`:\n\n```js\nexport const ready = Module.ready\nexport function hello() {\n  _hello() // Call WASM function \"hello\"\n}\n```\n\nConfig file `wasmc.js`\n\n```js\nmodule({\n  name:    \"foo\",\n  out:     \"dist/foo.js\",\n  jsentry: \"foo.js\",\n  sources: \"*.c\",\n})\n```\n\nBuild:\n\n```\n$ wasmc\n```\n\nGenerated `dist/foo.js`:\n\n```js\n(function(exports){\n  \"use strict\";\n  // -- emscripten bootstrap code here --\n  Object.defineProperty(exports,\"__esModule\",{value:!0});\n  exports.ready = Module.ready;\n  exports.hello = function() {\n    _hello();\n  };\n})(typeof exports!='undefined'?exports:this[\"foo\"]={})\n//# sourceMappingURL=foo.js.map\n```\n\nRun:\n\n```\n$ node -e 'require(\"./out/foo.js\").ready.then(m =\u003e m.hello())'\nHello from wasm\n```\n\n\n### Configuration file\n\nwasmc looks for `wasmc.js` in the project directory and evaluates it.\n\nYou can define modules (WASM products) and \"libs\" (collection of C and/or C++ files\ncompiled with certain flags) in this file.\n\n- See [`examples/example/wasmc.js`](examples/example/wasmc.js) for an example.\n- See [`misc/config-file.d.ts`](misc/config-file.d.ts) for a complete API description of the configuration file.\n\n\n## Building from source\n\n```\nnpm install\n./misc/build.sh\n```\n\n- Release product: `wasmc`\n- Debug product: `wasmc.g`\n- Build only the debug product: `./misc/build.sh -g`\n- Build debug product while watching source files: `./misc/build.sh -w`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsms%2Fjs-wasmc","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frsms%2Fjs-wasmc","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frsms%2Fjs-wasmc/lists"}