A fetch API implementation for AssemblyScript (WebAssembly) that supports both asynchronous and synchronous HTTP requests. Current stable version is 2.1.4, with periodic releases. Key differentiators: fully typed for AssemblyScript, offers optional synchronous mode via transform, and provides both raw and ESM bindings for host integration. Unlike JavaScript fetch, it requires explicit binding setup and response handler exports. Suitable for AssemblyScript projects needing HTTP client functionality in WebAssembly.
npm install as-fetchNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates async fetch in AssemblyScript with response handler export and basic usage.
Add 'export { responseHandler } from 'as-fetch/assembly';' to your module.Add '--transform as-fetch/transform' to asc command or configure in asconfig.json.
Ensure fetch is available in the host environment (Node, browser) and pass it to FetchHandler: new FetchHandler(fetch).
Add 'export { responseHandler } from 'as-fetch/assembly';' to your AssemblyScript entry file.Ensure you use '--transform as-fetch/transform' in asc command and import fetchSync from 'as-fetch/sync'.
Use 'const Fetch = new FetchHandler(fetch);' and verify fetch is defined.