{"_id":"@aligheisar/fetch-kit","_rev":"2-e539f632eaa3b498516d15665dcc6389","name":"@aligheisar/fetch-kit","dist-tags":{"latest":"0.1.1"},"versions":{"0.1.0":{"name":"@aligheisar/fetch-kit","version":"0.1.0","keywords":["fetch","fetch-wrapper","fetch-kit","api","typescript","javascript","utilities"],"author":{"url":"https://github.com/aligheisar","name":"Ali Gheisar","email":"ali.gheisar.dev@gmail.com"},"license":"ISC","_id":"@aligheisar/fetch-kit@0.1.0","maintainers":[{"name":"aligheisar","email":"ali.gheisar.dev@gmail.com"}],"homepage":"https://github.com/aligheisar/fetch-kit","bugs":{"url":"https://github.com/aligheisar/fetch-kit/issues"},"dist":{"shasum":"0bd917ef100838c7b7ac9b4fe3bd63adf17f1a2b","tarball":"https://registry.npmjs.org/@aligheisar/fetch-kit/-/fetch-kit-0.1.0.tgz","fileCount":21,"integrity":"sha512-l8Kiy4E2fyTlbRJzGUu0Q9jXrY+erC/8mfpcmt+8tkaU2B+970EUTbqW94LXbrv9+0y1TiqyQTYtrZddn+cUcA==","signatures":[{"sig":"MEUCIDpMIaTueqnAjNWRUx8X0G+RqvCx9T+DAJUi9DdSM0I8AiEA8gvTfrJUr8LEzwHFY160g1Q2sTioi7FhImapP+PaDzg=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":13309},"main":"./dist/index.cjs","type":"module","_from":"file:aligheisar-fetch-kit-0.1.0.tgz","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./c-fetch":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./v-fetch":{"import":"./dist/v-fetch.js","require":"./dist/v-fetch.cjs"}},"scripts":{"dev":"tsup --watch","lint":"biome lint","build":"tsup","check":"biome check","format":"biome format --write","lint:fix":"biome lint --write","check:fix":"biome check --write","lint-staged":"lint-staged"},"_npmUser":{"name":"aligheisar","email":"ali.gheisar.dev@gmail.com"},"_resolved":"/tmp/6380869da32bbd925494dd7ff3a7e455/aligheisar-fetch-kit-0.1.0.tgz","_integrity":"sha512-l8Kiy4E2fyTlbRJzGUu0Q9jXrY+erC/8mfpcmt+8tkaU2B+970EUTbqW94LXbrv9+0y1TiqyQTYtrZddn+cUcA==","repository":{"url":"git+https://github.com/aligheisar/fetch-kit.git","type":"git"},"_npmVersion":"11.5.1","description":"A type-safe Fetch API wrapper with optional runtime validation.","directories":{},"sideEffects":false,"_nodeVersion":"24.6.0","_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.5.1","husky":"^9.1.7","typescript":"^5.9.3","lint-staged":"^16.2.7","@biomejs/biome":"^2.3.13"},"peerDependencies":{"valibot":">=1.0.0","@aligheisar/http-utils":">=0.1.0"},"peerDependenciesMeta":{"valibot":{"optional":true}},"_npmOperationalInternal":{"tmp":"tmp/fetch-kit_0.1.0_1769700671735_0.8079605672491219","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aligheisar/fetch-kit","version":"0.1.1","description":"A type-safe Fetch API wrapper with optional runtime validation.","author":{"name":"Ali Gheisar","email":"ali.gheisar.dev@gmail.com","url":"https://github.com/aligheisar"},"repository":{"type":"git","url":"git+https://github.com/aligheisar/fetch-kit.git"},"homepage":"https://github.com/aligheisar/fetch-kit","keywords":["fetch","fetch-wrapper","fetch-kit","api","typescript","javascript","utilities"],"license":"ISC","type":"module","main":"./dist/index.cjs","module":"./dist/index.js","types":"./dist/index.d.ts","exports":{".":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./c-fetch":{"import":"./dist/index.js","require":"./dist/index.cjs"},"./v-fetch":{"import":"./dist/v-fetch.js","require":"./dist/v-fetch.cjs"}},"sideEffects":false,"devDependencies":{"@biomejs/biome":"^2.3.13","husky":"^9.1.7","lint-staged":"^16.2.7","tsup":"^8.5.1","typescript":"^5.9.3"},"peerDependencies":{"@aligheisar/http-utils":">=0.1.0","valibot":">=1.0.0"},"peerDependenciesMeta":{"valibot":{"optional":true}},"scripts":{"build":"tsup","dev":"tsup --watch","lint":"biome lint","lint:fix":"biome lint --write","check":"biome check","check:fix":"biome check --write","format":"biome format --write","lint-staged":"lint-staged"},"_id":"@aligheisar/fetch-kit@0.1.1","bugs":{"url":"https://github.com/aligheisar/fetch-kit/issues"},"_integrity":"sha512-4688Y2nC+Gkf0+ognzeLfVDOeWEC709ZOlortlKvtJK9KKqgQslaybOjP/U2x1WJLAdRX6mGKXBLx26scLgfaQ==","_resolved":"/tmp/91c7b7fff52c326c7ba7340466b229ad/aligheisar-fetch-kit-0.1.1.tgz","_from":"file:aligheisar-fetch-kit-0.1.1.tgz","_nodeVersion":"24.6.0","_npmVersion":"11.5.1","dist":{"integrity":"sha512-4688Y2nC+Gkf0+ognzeLfVDOeWEC709ZOlortlKvtJK9KKqgQslaybOjP/U2x1WJLAdRX6mGKXBLx26scLgfaQ==","shasum":"07d8adaf17e6ccef8ac9497d4e7829f7ba6d6c82","tarball":"https://registry.npmjs.org/@aligheisar/fetch-kit/-/fetch-kit-0.1.1.tgz","fileCount":21,"unpackedSize":15059,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIGHxP0PsPLibxASAy0ixnB6j6d/cXdfa8w4TrqaUeafnAiEAvsEgj7sy/WAo5x1zSmouzslCs6jGevsYRBd0sRw2zL4="}]},"_npmUser":{"name":"aligheisar","email":"ali.gheisar.dev@gmail.com"},"directories":{},"maintainers":[{"name":"aligheisar","email":"ali.gheisar.dev@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/fetch-kit_0.1.1_1769760536365_0.7767140716564933"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-29T15:31:11.548Z","modified":"2026-01-30T08:08:56.653Z","0.1.0":"2026-01-29T15:31:11.889Z","0.1.1":"2026-01-30T08:08:56.516Z"},"bugs":{"url":"https://github.com/aligheisar/fetch-kit/issues"},"author":{"name":"Ali Gheisar","email":"ali.gheisar.dev@gmail.com","url":"https://github.com/aligheisar"},"license":"ISC","homepage":"https://github.com/aligheisar/fetch-kit","keywords":["fetch","fetch-wrapper","fetch-kit","api","typescript","javascript","utilities"],"repository":{"type":"git","url":"git+https://github.com/aligheisar/fetch-kit.git"},"description":"A type-safe Fetch API wrapper with optional runtime validation.","maintainers":[{"name":"aligheisar","email":"ali.gheisar.dev@gmail.com"}],"readme":"# @aligheisar/fetch-kit\n\nA small, focused fetch wrapper with optional runtime validation.\n\n`fetch-kit` provides a thin, predictable layer on top of the native Fetch API. It gives you a small set of focused fetch helpers with different levels of safety, depending on what you need.\n\nNo abstractions you didn’t ask for. Just safer data handling.\n\n## Installation\n\n```bash\nnpm install @aligheisar/fetch-kit\n```\n\nor\n\n```bash\npnpm add @aligheisar/fetch-kit\n```\n\nor\n\n```bash\nyarn add @aligheisar/fetch-kit\n```\n\n## cFetch\n\n```ts\nimport { cFetch } from \"@aligheisar/fetch-kit\";\n```\n\n### API\n\n```ts\nfunction cFetch<T = unknown>(\n  url: UrlType,\n  options?: FetchOptions\n): Promise<T>;\n```\n\n### Example\n\n```ts\ntype User = {\n  id: string;\n  name: string;\n};\n\nconst user = await cFetch<User>(\"/api/user\");\n```\n\n`cFetch` assumes the response body already matches your expectations. No runtime validation is performed.\n\n## vFetch (validated fetch)\n\n```ts\nimport { vFetch } from \"@aligheisar/fetch-kit/v-fetch\";\n```\n\n`vFetch` parses and validates the response using a Valibot schema. If validation fails, an error is thrown.\n\n**Note**\nTo use `vFetch`, you must install `valibot` as a dependency:\n\n```bash\nnpm install valibot\n```\n\n### API\n\n```ts\nfunction vFetch<\n  Schema extends BaseSchema<unknown, unknown, BaseIssue<unknown>>\n>(\n  url: UrlType,\n  schema: Schema,\n  options?: FetchOptions\n): Promise<InferOutput<Schema>>;\n```\n\n### Example\n\n```ts\nimport { object, string } from \"valibot\";\nimport { vFetch } from \"@aligheisar/fetch-kit/v-fetch\";\n\nconst UserSchema = object({\n  id: string(),\n  name: string(),\n});\n\nconst user = await vFetch(\"/api/user\", UserSchema);\n```\n\nIf the API returns invalid data, `vFetch` fails fast instead of letting bad data flow through your app.\n","readmeFilename":"README.md"}