{"id":23222960,"url":"https://github.com/dckt/rescript-msw","last_synced_at":"2026-01-18T22:34:06.264Z","repository":{"id":223601416,"uuid":"760998800","full_name":"DCKT/rescript-msw","owner":"DCKT","description":"ReScript bindings for MSW library","archived":false,"fork":false,"pushed_at":"2024-02-21T03:59:19.000Z","size":15,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-05T16:35:05.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"ReScript","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/DCKT.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2024-02-21T03:34:18.000Z","updated_at":"2024-02-21T03:34:24.000Z","dependencies_parsed_at":"2024-02-21T04:41:55.601Z","dependency_job_id":"c1570982-afcb-4c35-ac45-2c767d4cfc27","html_url":"https://github.com/DCKT/rescript-msw","commit_stats":null,"previous_names":["dckt/rescript-msw"],"tags_count":1,"template":false,"template_full_name":"DCKT/rescript-bindings-template","purl":"pkg:github/DCKT/rescript-msw","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Frescript-msw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Frescript-msw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Frescript-msw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Frescript-msw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DCKT","download_url":"https://codeload.github.com/DCKT/rescript-msw/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DCKT%2Frescript-msw/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28552786,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-18T20:59:07.572Z","status":"ssl_error","status_checked_at":"2026-01-18T20:59:02.799Z","response_time":98,"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-12-18T23:15:32.463Z","updated_at":"2026-01-18T22:34:06.248Z","avatar_url":"https://github.com/DCKT.png","language":"ReScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# rescript-msw\n\nReScript bindings for [msw](https://mswjs.io/) (targeted version : `^2.2.1`)\n\n## Setup\n\n1. Install the module\n\n```bash\nbun install @dck/rescript-msw\n# or\nyarn install @dck/rescript-msw\n# or\nnpm install @dck/rescript-msw\n```\n\n2. Add it to your `rescript.json` config\n\n```json\n{\n  \"bs-dependencies\": [\"@dck/rescript-msw\"]\n}\n```\n\n## Usage\n\nThe functions can be accessed through `Msw` module.\n\n```rescript\n@spice\ntype example = {\n  id: string,\n  username: string,\n  age: int\n}\n\nlet worker = Msw.setupWorker([\n  Msw.Http.get(\"https://fakeapi.com/test\", _ =\u003e {\n    let ex: example = {\n      id: \"id\",\n      username: \"mock\",\n      age: 31\n    }\n    Msw.HttpResponse.jsonUnsafe(ex)\n  }),\n  Msw.Http.get(\"https://fakeapi.com/params/:id\", ({params}) =\u003e {\n    let paramsId = params-\u003eJs.Dict.get(\"id\")\n\n    let ex: example = {\n      id: paramsId-\u003eOption.getOr(\"1\"),\n      username: \"mock\",\n      age: 31,\n    }\n    Msw.HttpResponse.json(ex-\u003eexample_encode)\n  }),\n])\n```\n\n## Development\n\nInstall deps\n\n```bash\nbun install\n```\n\nCompiles files\n\n```bash\nbun run dev\n```\n\nRun tests\n\n```bash\nbun test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdckt%2Frescript-msw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdckt%2Frescript-msw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdckt%2Frescript-msw/lists"}