Got is a human-friendly and powerful HTTP request library for Node.js, currently at v15.0.2. It provides a modern Promise-based API for making HTTP requests, including features like retry mechanisms, hooks, and stream support. The library is actively maintained with frequent patch releases and major version updates that may introduce breaking changes, notably requiring Node.js 22+ and being ESM-only since v12 (reiterated in v15).
npm install gotVerified import paths — ran on the pinned version, not inferred.
Demonstrates making a POST request with a JSON payload and receiving a JSON response using Got's dedicated JSON mode.
Upgrade your Node.js runtime to version 22 or newer.
Use the standard `AbortController` and the `signal` option for request cancellation. For example: `const controller = new AbortController(); got('url', { signal: controller.signal }); controller.abort();`Use `got.stream()` directly for streaming requests instead of the `isStream` option.
Ensure your project is configured for ESM, or use dynamic `import()` if you cannot fully convert to ESM. For example: `const got = await import('got');`Evaluate if `Ky` or `fetch-extras` better fit your project's requirements, especially if you need browser support or a lighter-weight API.
Refactor your cancellation logic to use `AbortController` and the `signal` option: `const controller = new AbortController(); got('url', { signal: controller.signal }); controller.abort();`Convert your project or the specific file to use ES modules (`import`). Alternatively, use dynamic import: `const got = await import('got');`Upgrade `got` to version 14.6.6 or higher to resolve the stream auto-end issue for PATCH/DELETE/OPTIONS methods.
Remove the `isStream` option. Instead, use `got.stream()` directly for all streaming use cases.
No dependency data recorded yet.