ky
graffle
| ky | graffle | |
|---|---|---|
| 31 | 30 | |
| 16,906 | 6,110 | |
| 0.7% | -0.1% | |
| 8.6 | 8.9 | |
| about 1 month ago | 28 days ago | |
| TypeScript | TypeScript | |
| MIT License | MIT License |
Stars - the number of stars that a project has on GitHub. Growth - month over month growth in stars.
Activity is a relative number indicating how actively a project is being developed. Recent commits have higher weight than older ones.
For example, an activity of 9.0 indicates that a project is amongst the top 10% of the most actively developed projects that we are tracking.
ky
-
Our response to the Axios developer tool compromise
I usually reach for ky these days since it's an extremely lightweight wrapper over `fetch` - basically just adds a few niceties
https://github.com/sindresorhus/ky
From the readme:
- Simpler API
- Method shortcuts (ky.post())
- Treats non-2xx status codes as errors (after redirects)
- Retries failed requests
- JSON option
- Timeout support
- Upload and download progress
- Base URL option
- Instances with custom defaults
- Hooks
- Response validation with Standard Schema (Zod, Valibot, etc.)
- TypeScript niceties (e.g., .json() supports generics and defaults to unknown, not any)
Of course, this is only for projects where I have to make a lot of HTTP requests to a lot of different places where these niceties make sense. In most cases, we're usually using a library generated from an OpenAPI specification and fall back to `fetch` only as an escape hatch.
-
ky + p-limit: Concurrency Control With Built-in Retry for Batch Requests
Batch 100 API calls with Promise.all and the server returns 429. Add retry and transient network errors self-heal — but there's still no cap on how many run at once. ky handles per-request reliability. p-limit controls overall throughput. Both together is the complete solution.
-
ky: Stop Writing Fetch Boilerplate
Every project using fetch ends up with the same boilerplate: if (!response.ok) throw new Error(...). Add retry and you're writing a loop. Add timeout and you're pulling out AbortController. ky wraps all of that. 4KB, zero dependencies.
-
Decorating Promises Without Breaking Them
This came up while building convenience plugins for ffetch, a lightweight fetch wrapper focused on keeping native semantics intact. Libraries like ky solve the ergonomics problem by introducing a custom Response-like object, which works great until something outside the library expects a plain Response. I wanted a different path.
-
Prerelease of Ky 2.0
https://github.com/sindresorhus/ky?tab=readme-ov-file#how-is...
-
Axios VS Ky: When to use which?
Resources I used for writing this article: Ky: https://www.npmjs.com/package/@smeijer/ky?activeTab=readme https://github.com/sindresorhus/ky Axios: https://www.npmjs.com/package/axios?activeTab=readme https://axios-http.com/docs/intro
-
SvelteKit RPC with Hono
API-routes provide regular endpoints through folder hierarchy, giving you full control over request-response objects and middleware. You can use any HTTP client library—mine is ky.
- Fundamentals of React Native App Development: Dependencies, Performance, Native Modules, and Publishing Guide
- Ky: Tiny and elegant JavaScript HTTP client based on the browser Fetch API
- Ky is a tiny and elegant HTTP client based on the browser Fetch API
graffle
-
A Simple Way to Sign AWS Requests with Signature V4
The aws-sigv4-fetch package can be integrated into GraphQL libraries like graphql-request. For example, you can pass the signedFetch function as the custom fetch option:
-
Integrating GraphQL Codegen with Storyblok: Step-by-Step Guide
For Next.js projects, one of the options can be the typescript-graphql-request plugin. Under the hood this plugin works with the graphql-request library — a minimal, flexible, and easy-to-use GraphQL client. With typescript-graphql-request, we generate an SDK that is fully typed and allowing us to make strongly-typed GraphQL requests. This nicely integrates with data fetching in Next.js Server Components, enabling us to pre-render pages with data from Storyblok.
-
How to use SWR with GraphQL Apollo client?
but i don't want to use that external library
- Is graphql-request a good tool for only client side api? Share your feedbacks. Thanks 🙏
-
How to build a Snowflake API?
An example of a Snowflake API request using JavaScript. This example uses the graphql-request library to issue the actual GraphQL request. Install the dependency:
- 2022 Best GraphQL Client? Currently using GraphQL-CodeGen + Apollo Client
-
Four ways to fetch data from the GitHub GraphQL API in Next.js
I mentioned already we can use just about any client want when fetching GraphQL data. Prisma's graphql-request is a simple and lightweight option, and that is what I’ve used here.
-
Managing a Remix Site's Content With Sanity.io
To do this, you will make use of a tool called GraphQL Codegen to generate TypeScript types based on the GraphQL schema Sanity provides. You will then use graphql-request to actually fetch the data.
-
SvelteQuery vs KitQL vs others
What about https://github.com/prisma-labs/graphql-request that has 4.8k starts / 254 forks?
-
How do i type graphql????
If you don't want to use Apollo, I suggest using codegen + graphql-request. There is a codegen plugin for graphql-request that auto generates a typesafe client sdk with all your queries as methods on the graphql-request client. Super clean and lightweight. https://github.com/prisma-labs/graphql-request
What are some alternatives?
axios - Promise based HTTP client for the browser and node.js
graphql-client - A Ruby library for declaring, composing and executing GraphQL queries
wretch - A tiny wrapper built around fetch with an intuitive syntax. :candy:
graphql-typed-document-node - An improved version of `DocumentNode` for seamless TypeScript integration for GraphQL.
fetch - A small Fetch API wrapper
graphql-client - A GraphQL Client for .NET Standard