# Is request-promise ESM-only? Can you require() it?

> request-promise@4.2.6 is a CommonJS package. CommonJS — require() works on every Node.js version we test.

The simplified HTTP request client 'request' with Promise support. Powered by Bluebird.

Latest version 4.2.6, published Jul 22, 2020.

request-promise ships CommonJS only. require("request-promise") should work on every Node.js version the package supports (>=0.10.0); the runtime probe has not run for this version. import "request-promise" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

**Deprecated:** request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

## What to do

1. require("request-promise") should work on every Node.js version the package supports (>=0.10.0); the runtime probe has not run for this version.
2. From ES modules use the default import: import requestPromise from "request-promise"; then destructure. Named imports only work when Node.js can statically detect the exports.
3. TypeScript: npm install -D @types/request-promise
4. This package is deprecated: request-promise has been deprecated because it extends the now deprecated request package, see https://github.com/request/request/issues/3142

## Facts

- Latest: 4.2.6 (Jul 22, 2020)
- Module format: CommonJS
- Last CommonJS version: 4.2.6
- TypeScript types: @types/request-promise
- Node engines: >=0.10.0
- Weekly downloads: 841K
- License: ISC

## Runtime test results for request-promise@4.2.6

Runtime probe pending for this version (install failed: error: ConnectionRefused downloading package manifest request-promise). The facts above come from package.json.

## How to import request-promise

ES modules:

```js
import requestPromise from "request-promise";
```

CommonJS:

```js
const requestPromise = require("request-promise");
```

## Module format by version

Derived from the type, main and exports fields of every stable release on npm (42 versions; the newest 42 shown).

| Versions | Format | First published |
|---|---|---|
| 0.0.1 – 4.2.6 | CommonJS | Oct 4, 2013 |

## Frequently asked

**Is request-promise ESM-only?**

request-promise@4.2.6 is a CommonJS package. request-promise ships CommonJS only. require("request-promise") should work on every Node.js version the package supports (>=0.10.0); the runtime probe has not run for this version. import "request-promise" also works because Node.js and Bun can import CommonJS from ES modules, but only the default export is guaranteed; named imports depend on Node's static analysis of the module.

**Can I import request-promise with ES module syntax?**

Yes. import requestPromise from "request-promise" works in Node.js and Bun because they support importing CommonJS modules. Named imports work only when Node.js can statically detect the exports.

**Does request-promise ship TypeScript types?**

Not bundled. Install the community types with "npm install -D @types/request-promise".

## Links

- [request-promise on npm](https://www.npmjs.com/package/request-promise)
- [Source repository](https://github.com/request/request-promise)
- [HTML version](https://canirequire.com/package/request-promise/)
- [JSON version](https://canirequire.com/package/request-promise.json)

---

For scripts and AI agents: any package is at https://canirequire.com/package/<name>/index.md (Markdown) or https://canirequire.com/package/<name>.json (JSON); the site index is https://canirequire.com/llms.txt. Fetch the URL directly; no search needed.
