{"id":47561,"library":"feature-fetch","title":"feature-fetch","description":"Typed fetch client for JavaScript/TypeScript (v0.1.0) that returns tuple results [data, error] for safer error handling. Supports opt-in features like REST, OpenAPI, GraphQL, retry, and request caching. It differentiates from raw fetch and other clients (ky, axios) by providing type-safe responses out of the box and composable modular features. Currently in early development with rapid iteration.","status":"active","version":"0.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/builder-group/community","tags":["javascript","fetch","typed-fetch","http-client","api-client","typescript","type-safe","tuple-result","error-handling"],"install":[{"cmd":"npm install feature-fetch","lang":"bash","label":"npm"},{"cmd":"yarn add feature-fetch","lang":"bash","label":"yarn"},{"cmd":"pnpm add feature-fetch","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"ESM-only; requires Node >= 12 or bundler that supports ESM.","wrong":"const featureFetch = require('feature-fetch')","symbol":"featureFetch","correct":"import { featureFetch } from 'feature-fetch'"},{"note":"createClient is exported from main entry since v0.1.0.","wrong":"import { createClient } from 'feature-fetch/client'","symbol":"createClient","correct":"import { createClient } from 'feature-fetch'"},{"note":"Type is automatically inferred from tuple result; rarely needed explicitly.","wrong":"","symbol":"FetchError","correct":"import { FetchError } from 'feature-fetch'"},{"note":"ClientConfig is a type-only export; use import type to avoid runtime issues.","wrong":"import { ClientConfig } from 'feature-fetch'","symbol":"type ClientConfig","correct":"import type { ClientConfig } from 'feature-fetch'"}],"quickstart":{"code":"import { featureFetch } from 'feature-fetch';\n\nasync function getUser(id: string) {\n  const [error, user] = await featureFetch.get(`https://api.example.com/users/${id}`);\n  if (error) {\n    console.error('Failed to fetch user:', error);\n    return;\n  }\n  console.log('User:', user);\n}\n\ngetUser('123');","lang":"typescript","description":"Shows basic usage of featureFetch.get with tuple result for error-first handling."},"warnings":[{"fix":"Always destructure as [error, data].","message":"Tuple result order is [error, data] — not [data, error] like Go.","severity":"gotcha","affected_versions":">=0.0.1"},{"fix":"Use createClient with base config instead of per-call options.","message":"Options passed as second argument to each method (get, post, etc.) will be removed in v1.0 in favor of client-level config.","severity":"deprecated","affected_versions":">=0.1.0"},{"fix":"Handle Blob responses explicitly or use .text() method if needed.","message":"In v0.2.0, the return type for non-JSON responses changed from text to a Blob.","severity":"breaking","affected_versions":">=0.2.0"}],"env_vars":null,"search_vec":"'api':73 'api-cli':72 'axio':42 'box':52 'cach':32 'client':6,40,71,74 'compos':54 'current':57 'data':14 'develop':60 'differenti':34 'earli':59 'error':15,18,83 'error-handl':82 'featur':2,24,56 'feature-fetch':1 'fetch':3,5,37,65,68 'graphql':28 'handl':19,84 'http':70 'http-client':69 'iter':63 'javascript':64 'javascript/typescript':8 'ky':41 'like':25 'modular':55 'openapi':27 'opt':22 'opt-in':21 'provid':44 'rapid':62 'raw':36 'request':31 'respons':48 'rest':26 'result':13,81 'retri':29 'return':11 'safe':47,78 'safer':17 'support':20 'tupl':12,80 'tuple-result':79 'type':4,46,67,77 'type-saf':45,76 'typed-fetch':66 'typescript':75 'v0.1.0':9","created_at":"2026-06-07T16:52:08.655903+00:00","updated_at":"2026-06-07T16:52:08.655903+00:00","problems":[{"fix":"Set \"module\": \"ESNext\" and \"moduleResolution\": \"node\" or \"bundler\" in tsconfig.json.","cause":"Missing tsconfig.json configuration for ESM modules.","error":"Cannot find module 'feature-fetch' or its corresponding type declarations."},{"fix":"Use import { featureFetch } from 'feature-fetch' and ensure project uses ESM.","cause":"Using CommonJS require() instead of ESM import.","error":"TypeError: (0 , feature_fetch_1.featureFetch) is not a function"},{"fix":"Use clone() on response before retrying or set cache: 'no-store' in request options.","cause":"Reading response body twice when using retry feature.","error":"Uncaught TypeError: Failed to execute 'json' on 'Response': body stream already read"}],"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":"https://builder.group/?utm_source=package-json","github":"https://github.com/builder-group/community","docs":null,"changelog":null,"pypi":null,"npm":"feature-fetch","openapi_spec":null,"status_page":null,"smithery":null,"categories":["testing"],"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}}