{"id":17045436,"url":"https://github.com/ballercat/momo-loader","last_synced_at":"2026-05-06T04:03:07.614Z","repository":{"id":57301315,"uuid":"94693436","full_name":"ballercat/momo-loader","owner":"ballercat","description":":dizzy: Momo to wasm loader for Webpack ","archived":false,"fork":false,"pushed_at":"2017-06-18T15:37:02.000Z","size":16,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-10T21:06:09.812Z","etag":null,"topics":[],"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/ballercat.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":"2017-06-18T14:47:03.000Z","updated_at":"2017-06-19T12:35:08.000Z","dependencies_parsed_at":"2022-08-22T22:40:45.548Z","dependency_job_id":null,"html_url":"https://github.com/ballercat/momo-loader","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/ballercat%2Fmomo-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballercat%2Fmomo-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballercat%2Fmomo-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ballercat%2Fmomo-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ballercat","download_url":"https://codeload.github.com/ballercat/momo-loader/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244819062,"owners_count":20515613,"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":[],"created_at":"2024-10-14T09:37:24.808Z","updated_at":"2026-05-06T04:03:02.571Z","avatar_url":"https://github.com/ballercat.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# momo file loader for webpack\n\nCheckout [momo-language](https://github.com/maierfelix/momo) here. The fastest way to get up and running with WebAssembly.\n\nThis loader converts `.momo` files to `wasm` bytecode.\n\n## Install\n\n```\nnpm install --save-dev momo-loader wasm-loader\n```\n\n# Usage\n\nEdit webpack.config.js:\n\n```javascript\nresolve: [\n  extensions: ['.js', '.momo']\n],\n...\nloaders: [\n  {\n    test: /\\.wasm$/,\n    loaders: ['wasm-loader', 'momo-loader']\n  }\n]\n```\n\nYou can refer to `example.webpack.config.js` in this repo for an example.\n\n# Example\n\nHere we are going to use main.momo example, and save it to `/momo/main.momo`:\n\n```c\nint swap(int *c, int *d) {\n  int tmp = *c;\n  *c = *d;\n  *d = tmp;\n  return (0);\n};\n\nextern int main() {\n  int a = 10;\n  int b = 20;\n  int \u0026rb = b;\n  rb = 33;\n  swap(\u0026a, \u0026rb);\n  return (a);\n};\n```\n\nLater simply include the file in your JavaScript and instantiate the module:\n\n```javascript\nimport Main from '/momo/main';\n\nconst mainInstance = new Main();\nconsole.log(mainInstance.exports.main()) // 33\n```\n\nThat's it.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballercat%2Fmomo-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fballercat%2Fmomo-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fballercat%2Fmomo-loader/lists"}