{"id":18890927,"url":"https://github.com/igrep/purescript-node-webassembly","last_synced_at":"2026-02-11T20:06:17.364Z","repository":{"id":139468866,"uuid":"311850679","full_name":"igrep/purescript-node-webassembly","owner":"igrep","description":"Experimental FFI wrappers around the WebAssembly-related API in Node.js.","archived":false,"fork":false,"pushed_at":"2020-11-25T03:35:44.000Z","size":41,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-29T21:14:10.645Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/igrep.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,"zenodo":null}},"created_at":"2020-11-11T03:18:24.000Z","updated_at":"2020-11-30T15:23:27.000Z","dependencies_parsed_at":null,"dependency_job_id":"32a20a65-3543-46b3-8cdd-53759a26cb9a","html_url":"https://github.com/igrep/purescript-node-webassembly","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/igrep/purescript-node-webassembly","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrep%2Fpurescript-node-webassembly","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrep%2Fpurescript-node-webassembly/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrep%2Fpurescript-node-webassembly/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrep%2Fpurescript-node-webassembly/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/igrep","download_url":"https://codeload.github.com/igrep/purescript-node-webassembly/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/igrep%2Fpurescript-node-webassembly/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29343683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-11T18:58:20.535Z","status":"ssl_error","status_checked_at":"2026-02-11T18:56:44.814Z","response_time":97,"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-11-08T07:58:09.419Z","updated_at":"2026-02-11T20:06:17.345Z","avatar_url":"https://github.com/igrep.png","language":"PureScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# purescript-node-webassembly\n\nExperimental FFI wrappers around the WebAssembly-related API in Node.js.\n\n## Why?\n\nI'm creating a new web service using WebAssembly on the server side.\n\n## Current Status\n\nIt should work. But I don't publish it because:\n\n- Tested only in Node.js v15.2 (the latest version as of writing this document).\n    - Should be compatible with the browsers' API. But some of the browsers' features are not implemented yet (e.g. `compileStreaming`).\n- Requires `--experimental-wasi-unstable-preview1` option to the `node` command.\n    - See the \"Running the Tests\" section below when testing.\n\n## Running the Tests\n\n`spago test` doesn't work because you have to pass `--experimental-wasi-unstable-preview1` to node to run the tests:\n\n```sh\nspago build --then \"node --experimental-wasi-unstable-preview1 runTest.js\"\n```\n\nAnd to get a coverage report with `nyc` during the test:\n\n```\nspago build --purs-args=\"-g sourcemaps\" --then \"nyc node --experimental-wasi-unstable-preview1 runTest.js\"\n```\n\n## Design Notes\n\n### Nomenclature\n\nTo avoid name conflicts, this package contains exacly one module per one class (or object). So most of the wrapper methods have the same name with the wrapped methods in JavaScript. But there are some exceptions:\n\n- Wrapped methods which return a `Promise` are `foreign import`-ed by a name prefixed with `Impl`.\n    - E.g. `WebAssembly.compileImpl :: ArrayBuffer -\u003e Effect (Promise Module)`\n    - Then their `Aff` version is named without `Impl`.\n        - E.g. `WebAssembly.compile :: ArrayBuffer -\u003e Aff Module`\n- Constructors are named with `new`.\n    - E.g. `new WebAssembly.Module()` is wrapped by `WebAssembly.Module.new`.\n- Wrapped method which accepts various types of arguments are named with several different prefixes by their arguments' types.\n    - E.g. `new WebAssembly.Module({ initial })` is named as `WebAssembly.Module.new`\n    - E.g. `new WebAssembly.Module({ initial, maximum })` is named as `WebAssembly.Module.newWithMaximum`\n- Types which can be refined and the wrapped methods returning them and/or accepting them as the arguments are named prefixed with `Raw`.\n    - E.g.\n        - `WebAssembly.Module.exportsRaw :: Module -\u003e Array ModuleExportDescriptorRaw`\n        - And `WebAssembly.Module.exports :: Module -\u003e Array ModuleExportDescriptor`\n        - Where `ModuleExportDescriptorRaw` has `kind` as `String`\n        - While `ModuleExportDescriptor` has `kind` as `ImportExportKind`\n\n### Order of Arguments\n\nSome wrapped methods' order of arguments are swapped for more useful partial application of them.\nFor example, `WebAssembly.instantiate(buf, imports)` is wrapped by `instantiateRaw :: ImportObjectRaw -\u003e ArrayBuffer -\u003e Aff ResultObject`.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrep%2Fpurescript-node-webassembly","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Figrep%2Fpurescript-node-webassembly","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Figrep%2Fpurescript-node-webassembly/lists"}