{"_id":"@anuragdaksh7/net-client","name":"@anuragdaksh7/net-client","dist-tags":{"latest":"0.1.0"},"versions":{"0.1.0":{"name":"@anuragdaksh7/net-client","version":"0.1.0","description":"A framework-agnostic request-state API client built on fetch","module":"index.ts","main":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","types":"./dist/index.d.ts"}},"scripts":{"build":"tsup","prepublishOnly":"bun run build"},"keywords":["fetch","http","api","request-state","typescript","bun"],"author":{"name":"Anurag Daksh"},"license":"MIT","type":"module","devDependencies":{"@types/bun":"latest","tsup":"^8.5.1"},"peerDependencies":{"typescript":"^5"},"_id":"@anuragdaksh7/net-client@0.1.0","gitHead":"490e5842f0728c0ee7da1984744a47eb2d5fe679","_nodeVersion":"22.12.0","_npmVersion":"11.0.0","dist":{"integrity":"sha512-oIX6yctSkSJW0wadjj7yCxnZ9iEwaegWWJ9fPXS9/UaK6FNU1cYEClurzK2OS1iawg9bO9svcmRN+m9pb09gYg==","shasum":"bf6151ea312fde88e356748bf9559d61ec2802f9","tarball":"https://registry.npmjs.org/@anuragdaksh7/net-client/-/net-client-0.1.0.tgz","fileCount":4,"unpackedSize":7228,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEYCIQDEMlgL+YAL3r3Y0ICsIxWr28YWGQltTkTj1zc6fi2fmwIhAL9+UttF1v5YB/ksdzY0z7iIGkoKJGAGUfmTghznOGgz"}]},"_npmUser":{"name":"anuragdaksh7","email":"anuragdaksh77777@gmail.com"},"directories":{},"maintainers":[{"name":"anuragdaksh7","email":"anuragdaksh77777@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/net-client_0.1.0_1772046245958_0.340537643938855"},"_hasShrinkwrap":false}},"time":{"created":"2026-02-25T19:04:05.854Z","0.1.0":"2026-02-25T19:04:06.093Z","modified":"2026-02-25T19:04:06.326Z"},"maintainers":[{"name":"anuragdaksh7","email":"anuragdaksh77777@gmail.com"}],"description":"A framework-agnostic request-state API client built on fetch","keywords":["fetch","http","api","request-state","typescript","bun"],"author":{"name":"Anurag Daksh"},"license":"MIT","readme":"# Net Client (Request-State API Client)\n\nA **framework-agnostic, fetch-based API client** that gives you **per-request loading, data, and error state** — without React Query, Axios, or magic.\n\nBuilt out of real pain.\n\n---\n\n## Why this exists\n\nHandling API calls is one of the most **repetitive and messy** parts of building apps.\n\nMost codebases end up with:\n- global `loading` flags that break with concurrent requests\n- Axios responses typed as `any`\n- callbacks everywhere\n- hooks doing **transport + state + UI**\n- logic that works in React but not on the server\n\nHTTP clients return **Promises**.  \nApps need **request state**.\n\nThis library separates the two.\n\n---\n\n## Core idea\n\nInstead of this:\n\n```ts\nawait fetch(...)\n```\n\nYou get this:\n\n```ts\nrequest.run()\nrequest.loading\nrequest.data\nrequest.error\n```\n\nEach API call becomes a stateful request controller.\n\n---\n\n## What this library is (and isn’t)\n\nIt is\n- fetch-based\n- Bun / Node / Browser compatible\n- framework-agnostic\n- per-request state (loading / data / error)\n- usable in React and server scripts\n- explicit and predictable\n\nIt is not\n- a React-only library\n- a caching framework\n- a replacement for React Query\n- Axios with a different name\n- opinionated about UI or toasts\n\n---\n\n## Architecture\n```\nHttpClient        → HTTP transport (fetch, headers, errors)\ncreateRequest     → per-request state controller\nYour app          → UI / hooks / logs\n```","readmeFilename":"README.md","_rev":"1-5b84ddb45e5c3018f4c65b710e20c99b"}