{"id":19721024,"url":"https://github.com/paramsiddharth/patterns-wasm","last_synced_at":"2026-07-11T21:31:37.964Z","repository":{"id":50236480,"uuid":"310757399","full_name":"paramsiddharth/patterns-wasm","owner":"paramsiddharth","description":"A pattern generator coded in C and used in a webpage using WebAssembly.","archived":false,"fork":false,"pushed_at":"2021-06-01T02:36:49.000Z","size":784,"stargazers_count":0,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-24T08:25:24.798Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/paramsiddharth.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}},"created_at":"2020-11-07T03:15:19.000Z","updated_at":"2021-05-30T18:33:51.000Z","dependencies_parsed_at":"2022-09-02T10:22:05.465Z","dependency_job_id":null,"html_url":"https://github.com/paramsiddharth/patterns-wasm","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/paramsiddharth/patterns-wasm","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsiddharth%2Fpatterns-wasm","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsiddharth%2Fpatterns-wasm/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsiddharth%2Fpatterns-wasm/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsiddharth%2Fpatterns-wasm/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/paramsiddharth","download_url":"https://codeload.github.com/paramsiddharth/patterns-wasm/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/paramsiddharth%2Fpatterns-wasm/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35376133,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-11T02:00:05.354Z","response_time":104,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","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":[],"created_at":"2024-11-11T23:13:10.347Z","updated_at":"2026-07-11T21:31:37.896Z","avatar_url":"https://github.com/paramsiddharth.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pattern Generator\nA pattern generator coded in C and used in a webpage using WebAssembly.\n\n## Tools\nThe following tools would be required:\n- The Emscripten SDK (with `emcc`) and GCC : To compile the C source code to WASM and generate the JavaScript glue.\n- The Node Package Manager (`npm`) : To install the dependencies and start the server.\n\n## Development\n### Compiling to WebAssembly\nWhen inside the `src` directory, use GNU Make to compile the Pattern generator source code in C to WebAssembly by executing:\n``` bash\nmake\n```\n\nThis simply executes the following, exporting the `pattern` function to `data/pattern.wasm` and its glue-code to `data/pattern.js`:\n``` bash\nemcc -o ../data/pattern.js pattern.c -s WASM=1 -s EXTRA_EXPORTED_RUNTIME_METHODS='[\"cwrap\"]' -s EXPORTED_FUNCTIONS='[\"_pattern\"]'\n```\n\n`cwrap` is preferred over `ccall` because it lets us create a JavaScript wrapper around the C function, which we can call like any normal JavaScript function to receive the output.\n\nOptionally, one may test the `pattern` function by compiling `pattern.c` to an executable binary using GCC. The main function's job is only to run the user-defined test, and hence is not exported while building `pattern.wasm`. It can be done by executing:\n``` bash\nmake test\n```\n\n### Starting the Server\nInstall the dependencies via `package.json` using:\n``` bash\nnpm install\n```\n\nStart the local server at port 3000 using:\n``` bash\nnpm start\n```\n\nThe application will be running at http://localhost:3000/.  \n\\\n\\\nMade with ❤ by Param.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamsiddharth%2Fpatterns-wasm","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fparamsiddharth%2Fpatterns-wasm","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fparamsiddharth%2Fpatterns-wasm/lists"}