{"id":48741,"library":"node-fetch-core","title":"node-fetch-core","description":"A lightweight core set of fetch utilities optimized for Node.js environments, version 1.0.0. Provides a minimal, dependency-light implementation of the Fetch API spec tailored for server-side use, with support for streaming, timeouts, and custom agents. Differentiates from full-featured libraries like node-fetch by focusing on a lean core for building custom fetch wrappers.","status":"active","version":"1.0.0","language":"javascript","source_language":"en","source_url":null,"tags":["javascript"],"install":[{"cmd":"npm install node-fetch-core","lang":"bash","label":"npm"},{"cmd":"yarn add node-fetch-core","lang":"bash","label":"yarn"},{"cmd":"pnpm add node-fetch-core","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"This package is ESM-only. CommonJS require will fail unless using dynamic import().","wrong":"const fetchCore = require('node-fetch-core');","symbol":"default","correct":"import fetchCore from 'node-fetch-core'"},{"note":"Use 'import type' for type imports in TypeScript to avoid runtime errors.","wrong":"import { RequestInit } from 'node-fetch-core';","symbol":"RequestInit","correct":"import type { RequestInit } from 'node-fetch-core'"},{"note":"AbortError is a named export, not default.","wrong":"import AbortError from 'node-fetch-core';","symbol":"AbortError","correct":"import { AbortError } from 'node-fetch-core'"}],"quickstart":{"code":"import fetchCore from 'node-fetch-core';\nimport { AbortController } from 'node-fetch-core'; // or from 'abort-controller' if not bundled\n\nasync function getData() {\n  const controller = new AbortController();\n  const timeout = setTimeout(() => controller.abort(), 5000);\n  try {\n    const response = await fetchCore('https://api.example.com/data', {\n      signal: controller.signal\n    });\n    const data = await response.json();\n    console.log(data);\n  } catch (err) {\n    if (err.name === 'AbortError') {\n      console.error('Request timed out');\n    } else {\n      console.error(err);\n    }\n  } finally {\n    clearTimeout(timeout);\n  }\n}\ngetData();","lang":"typescript","description":"Shows how to make a fetch request with timeout using AbortController."},"warnings":[{"fix":"Use import() syntax or set \"type\": \"module\" in your package.json.","message":"This package is ESM-only. Using require() will throw an error. Use dynamic import() or configure your project for ESM.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Install 'abort-controller' polyfill for Node.js <15 or upgrade Node.","message":"AbortController is not included by default in Node.js <15. You may need to polyfill it.","severity":"breaking","affected_versions":">=1.0.0"},{"fix":"Use response.buffer() or response.text() instead, or ensure Node.js >=18.","message":"The returned Response object does not support .body (readable stream) in Node.js <18 without additional polyfill.","severity":"gotcha","affected_versions":">=1.0.0"}],"env_vars":null,"search_vec":"'1.0.0':17 'agent':43 'api':28 'build':61 'core':4,7,59 'custom':42,62 'depend':22 'dependency-light':21 'differenti':44 'environ':15 'featur':48 'fetch':3,10,27,53,63 'focus':55 'full':47 'full-featur':46 'implement':24 'javascript':65 'lean':58 'librari':49 'light':23 'lightweight':6 'like':50 'minim':20 'node':2,52 'node-fetch':51 'node-fetch-cor':1 'node.js':14 'optim':12 'provid':18 'server':33 'server-sid':32 'set':8 'side':34 'spec':29 'stream':39 'support':37 'tailor':30 'timeout':40 'use':35 'util':11 'version':16 'wrapper':64","created_at":"2026-06-07T16:58:13.937949+00:00","updated_at":"2026-06-07T16:58:13.937949+00:00","problems":[{"fix":"Switch to import() or set \"type\": \"module\" in package.json.","cause":"Using require() on an ESM-only package.","error":"ERR_REQUIRE_ESM"},{"fix":"Install 'abort-controller' with npm install abort-controller and import it.","cause":"Missing polyfill for AbortController in older Node.js versions.","error":"TypeError: AbortController is not a constructor"},{"fix":"Use response.buffer() or response.text() for reading the response.","cause":"Trying to access .body (ReadableStream) in Node.js <18.","error":"TypeError: response.body is undefined"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":null,"github":null,"docs":null,"changelog":null,"pypi":null,"npm":"node-fetch-core","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-07","next_check":"2026-09-05","install_tag":null}}