A wrapper around node-fetch that adds automatic cookie handling, easy query/form/JSON body serialization, and optional cookie persistence to disk. Version 3.1.2 is the current stable release. Maintained via GitHub Actions. Simplifies common fetch patterns compared to raw node-fetch by providing convenience methods for GET, POST, PUT, DELETE with built-in encoding support via iconv-lite. Ships TypeScript type definitions.
npm install advanced-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Creates a Fetch instance with cookie persistence, sends a POST request with JSON body and query params.
Use new Fetch({ cookiesFilename: '', encoding: '' }).Pin tough-cookie to v3 or implement custom cookie jar.
Set returnBuffer: true to get a Buffer for binary responses.
Use valid iconv-lite encoding names; see iconv-lite documentation.
Pass query as a string or use a different library for complex queries.
import { Fetch } from 'advanced-fetch'npm install node-fetch
Pass { cookiesFilename: '/path/to/cookies.json' } to constructor.