{"id":16222821,"url":"https://github.com/ssssota/msw-connect-web","last_synced_at":"2025-06-16T01:37:57.979Z","repository":{"id":65556330,"uuid":"594336975","full_name":"ssssota/msw-connect-web","owner":"ssssota","description":"Mock Service Worker utility for connect-web.","archived":false,"fork":false,"pushed_at":"2023-01-29T13:28:05.000Z","size":71,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-12T00:45:46.720Z","etag":null,"topics":["connect-web","grpc","mock","msw"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ssssota.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2023-01-28T08:15:10.000Z","updated_at":"2024-12-22T08:19:30.000Z","dependencies_parsed_at":"2023-02-15T22:01:04.160Z","dependency_job_id":null,"html_url":"https://github.com/ssssota/msw-connect-web","commit_stats":{"total_commits":22,"total_committers":3,"mean_commits":7.333333333333333,"dds":"0.18181818181818177","last_synced_commit":"185b7d52e532b94d94fc7033fee6df42e0766ca3"},"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/ssssota/msw-connect-web","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssssota%2Fmsw-connect-web","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssssota%2Fmsw-connect-web/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssssota%2Fmsw-connect-web/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssssota%2Fmsw-connect-web/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ssssota","download_url":"https://codeload.github.com/ssssota/msw-connect-web/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ssssota%2Fmsw-connect-web/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259719590,"owners_count":22901231,"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":["connect-web","grpc","mock","msw"],"created_at":"2024-10-10T12:15:23.402Z","updated_at":"2025-06-16T01:37:57.960Z","avatar_url":"https://github.com/ssssota.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# msw-connect-web\n\n[Mock Service Worker](https://mswjs.io/) utility for [connect-web](https://github.com/bufbuild/connect-web).\n\n🚧 Streaming requests and responses are not currently supported.\n\n🚧 And server-side mocking is currently not supported either. (Because MSW has no support for Node.js `globalThis.fetch`. [mswjs/interceptors#283](https://github.com/mswjs/interceptors/pull/283))\n\nIf you want to mock on the server-side, you can use [connect-web-mock-interceptor](https://www.npmjs.com/package/connect-web-mock-interceptor).\n\n## Usage\n\nInstall package.\n\n```sh\nnpm i -D msw-connect-web msw\n```\n\nDefine mocks.\n\n_handlers.ts_\n\n```typescript\nimport { createMswConnectWeb } from 'msw-connect-web';\nconst connect = createMswConnectWeb({ baseUrl: 'https://...' });\nexport const handlers = [\n  connect(YourService, 'methodName', async (req, res, ctx) =\u003e {\n    // You can access the request message (with types) using the `message` method.\n    const requestMessage = await req.message();\n    return res(\n      ctx.delay(1000),\n      // You can define response with `message` method.\n      ctx.message(new ResponseMessage({ ... })),\n    );\n  }),\n];\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssssota%2Fmsw-connect-web","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fssssota%2Fmsw-connect-web","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fssssota%2Fmsw-connect-web/lists"}