Make a fetch request from a HAR (HTTP Archive) definition. Current stable version is 12.0.4, requiring Node >=22 and ESM. Converts HAR log entries into native fetch() calls, supporting Node 18+ and all browsers with native fetch. Key differentiators: no polyfills needed, works across browsers and Node, supports file uploads from buffers or File objects, and integrates with mocking libraries like nock or MSW. Maintained by readme.io with cross-browser CI testing.
npm install fetch-harNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates importing fetch-har, constructing a HAR object with an Authorization header, calling fetchHAR, and parsing the JSON response.
Upgrade Node to v22 or later, or downgrade fetch-har to v11.x.
Always provide a files map when dealing with multipart/form-data HAR entries without data URLs.
Do not rely on custom body/credentials in init if the HAR specifies them.
Use import statement or set type: module in package.json.
Use default import: import fetchHAR from 'fetch-har'.
Provide a files map with a buffer/File for the parameter name, or add a data URL to the HAR entry.
No dependency data recorded yet.