request

The once-ubiquitous, now officially deprecated Node.js HTTP request client

Library
npm
v2.88.2
25,486 stars
Apache License 2.0

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
46 /100 Fair
Development Activity 0
Maintenance 0
Community 84
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
64 /100 Good
Architecture 65
Code Quality 72
Innovation 40
Learning Curve 80

request was, for most of the 2010s, the de facto standard HTTP client for Node.js, offering a single simple function supporting callbacks, streaming, redirects, cookie jars, multipart forms, OAuth, and HAR-based request replay. It was officially deprecated by its maintainers on February 11, 2020, with no further changes expected to land, in favor of newer promise/async-based clients.

Despite its deprecated status, request remains deeply embedded as a transitive dependency across the npm ecosystem, and its README continues to be referenced as the canonical example of Node’s early callback/streaming HTTP idioms. It is documented here as a widely-installed legacy library rather than a recommendation for new projects.

What You Get

  • A single request() function supporting both callback and streaming (pipe-based) response handling
  • Automatic HTTPS and redirect handling out of the box
  • Built-in cookie jar, multipart/form-data, and OAuth request signing support
  • HAR (HTTP Archive) format request support for replaying captured requests
  • A large, still-widely-installed transitive footprint across the npm ecosystem

Common Use Cases

  • Legacy Node.js codebases and tooling that were built against request’s callback/streaming API before promise-based clients became standard
  • Reading and understanding older Node.js tutorials and Stack Overflow answers that still reference request as the example HTTP client
  • Maintaining or migrating off of older dependency trees that pull request in transitively
  • Studying stream-based HTTP request/response piping patterns in Node.js (e.g. piping a response directly to a file write stream)

Under The Hood

Architecture: The library’s core (request.js, ~1,550 lines) implements a single Request object that extends Node’s Stream and wires together the request lifecycle — DNS/proxy resolution, redirect following, and response piping — as a sequence of event-driven steps rather than a promise chain, reflecting Node’s pre-async/await conventions. Cross-cutting concerns (cookies, auth, multipart, OAuth, HAR replay) are split into separate modules under lib/ (cookies.js, auth.js, multipart.js, oauth.js, har.js) that the core request pipeline composes together at request time.

Tech Stack: Plain CommonJS JavaScript targeting Node’s built-in http/https modules directly, with dependencies on now-largely-legacy helper packages (har-validator, tunnel-agent, forever-agent) that were common in the pre-2018 Node ecosystem.

Code Quality: The tests/ directory is extensive (test-agent, test-api, test-aws, test-cookies, and more), reflecting years of production hardening, but the project has had zero commits and zero releases since 2020 per GitHub activity data, and the README leads with a formal deprecation notice pointing users to the discussion issue and alternative clients.

API Design: The single-function callback/stream API (request(url, callback) or request(url).pipe(...)) was praised in its era for simplicity, but by modern standards requires wrapper libraries (request-promise, request-promise-native) to get promise/async-await ergonomics — a real gap relative to fetch-based or axios-style clients that support promises natively.

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers