# Nock HTTP Server Mocking and Expectations Library for Node.js

> Nock is an HTTP server mocking and expectations library for Node.js that intercepts outgoing HTTP requests and provides programmable responses. With over 13,000 GitHub stars and 5.5 million weekly npm downloads, it is one of the most widely used testing utilities in the JavaScript ecosystem.

- Skill: `agentskillexchange/nock-http-server-mocking-and-expectations-library-for-node-j` (Agent Skill)
- Install (CLI): `npx skillmds@latest add agentskillexchange/nock-http-server-mocking-and-expectations-library-for-node-j`
- Raw SKILL.md: https://api.skillmd.com/api/skills/agentskillexchange/nock-http-server-mocking-and-expectations-library-for-node-j/raw
- Safety review: pending (external: skill-scanner PASS, skillspector PASS)
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- Author: agentskillexchange (https://skillmd.com/u/agentskillexchange)
- Updated: 2026-09-08
- Page: https://skillmd.com/skills/agentskillexchange/nock-http-server-mocking-and-expectations-library-for-node-j

---


# Nock HTTP Server Mocking and Expectations Library for Node.js

Nock is an HTTP server mocking and expectations library for Node.js that intercepts outgoing HTTP requests and provides programmable responses. With over 13,000 GitHub stars and 5.5 million weekly npm downloads, it is one of the most widely used testing utilities in the JavaScript ecosystem.

## Installation

Use the upstream install or setup path that matches your environment:
- $ npm install --save-dev nock

Requirements and caveats from upstream:
- HTTP server mocking and expectations library for Node.js
- [Node version support](#node-version-support)
- Nock works by overriding Node's http.request function. Also, it overrides http.ClientRequest too to cover for modules that use it directly.

Basic usage or getting-started notes:
- [Usage](#usage)
- [Usage](#usage-1)
- [Example](#example)

- Source: https://github.com/nock/nock
- Extracted from upstream docs: https://raw.githubusercontent.com/nock/nock/HEAD/README.md

## Documentation

- https://github.com/nock/nock#readme

## Source

- [Agent Skill Exchange](https://agentskillexchange.com/skills/nock-http-server-mocking-nodejs/)

