
Mock Service Worker
API mocking library for JavaScript that intercepts requests in the browser and in Node.js and answers them with mocked responses.
Mock Service Worker is an API mocking library for JavaScript that answers an application’s requests with mocked responses while the application code stays unchanged. In the browser it uses the Service Worker API to intercept requests at the network level. In Node.js it intercepts requests at the socket level, and the same request handlers serve tests, local development and debugging in both environments.
Handlers use an Express-like routing syntax and can describe REST, GraphQL, Server-Sent Events and WebSocket traffic. The documentation covers setup for each environment, and a comparison page sets it beside Nock, JSON Server, Mirage, Cypress and Playwright.
Worth knowing
The FAQ says Node.js versions below a stated minimum are not supported.
Identity
- Status
- Active
- Maintainer
- Artem Zakharchenko4
- Maintained by
- Individual4
- First release
- 20185
Rendering and deploy
- Install with
- npm7
Releases
Adoption
Sources
- 2026-11-16: links, Categories, Runtime
mswjs.io - 2026-11-16: links
mswjs.io/docs/ - 2026-11-16: links, Written in, GitHub stars
api.github.com/repos/mswjs/msw - 2026-11-16: Maintainer, Maintained by, License, License model
github.com/mswjs/msw/blob/main/LICENSE.md - 2026-11-16: First release
registry.npmjs.org/msw - 2026-11-16: Current major version, Last release
api.github.com/repos/mswjs/msw/releases - 2026-11-16: Install with
mswjs.io/docs/quick-start - 2026-11-16: npm downloads a week
api.npmjs.org/downloads/range/2026-11-01:2026-11-07/msw - 2026-11-16: Dependent packages, Dependent repositories
packages.ecosyste.ms/api/v1/registries/npmjs.org/packages/msw - 2026-11-16: Contributors
api.github.com/repos/mswjs/msw/contributors?per_page=1