Suggest a tool

Nock

Metrics as of , from the GitHub or GitLab API of each repository. Refreshed monthly.

What Nock is

Nock is a Node.js library for HTTP server mocking and expectations. Tests use it to exercise modules that make HTTP requests without reaching the real servers. It works by overriding Node's http.request function and http.ClientRequest. Tests define interceptors that match a hostname, path, method, request body, query string or headers and return a specified reply. An interceptor is removed after one use unless it is persisted or repeated. Replies can be delayed, return errors or repeat a set number of times. Helpers such as isDone and pendingMocks report mocks that were never called. A recorder captures real HTTP traffic for reuse. Nock Back records fixtures to a directory and plays them back.

Written from the project's README, read .

Category
Test data and mocking
License
MIT
Language
JavaScript
Changelog
Releases on GitHub

Repository metrics

Repository metrics
Stars13,1261
Forks7681
Open issues and PRs1001
Contributors3131
Commits in the last 90 days31
Last commit2026-07-301
Last releasev14.0.17, 2026-07-301
Fetched

1 Fetched from the GitHub or GitLab API on . Hover a value for its own date.

Status

activeLast commit within 90 days of the fetch date.

Computed from the last commit date and the archive flag on the fetch date. See the status rules.

Alternatives

Listed test data and mocking tools, same primary language first, then by GitHub stars. Each line gives one fact from the tool's documentation where it differs from Nock's, with its source.

How to install

npm install --save-dev nock
From README, read .

Questions

Is Nock open source?

Yes. Nock is released under MIT, an OSI-approved license, as reported by the GitHub API on 2026-09-22.

Is Nock maintained?

On 2026-09-22, the last commit to the default branch was on 2026-07-30, so the listed status is active. Rule: Last commit within 90 days of the fetch date.

How many GitHub stars does Nock have?

13,126 stars on 2026-09-22, from the GitHub API. The number is refreshed at each monthly update.

What language is Nock written in?

The repository's primary language, as reported by the GitHub API, is JavaScript.

How do I install Nock?

The README gives this command: npm install --save-dev nock

Sources

  1. GitHub REST API: repository, read
  2. GitHub REST API: commits, read
  3. GitHub REST API: latest release, read
  4. GitHub REST API: contributors, read
  5. README, read