Comments (10)
From a quick glance at r2
, the main benefits of ky
are:
- Built for the browser only.
r2
targets Node.js too, which means it has to target the lowest common denominator.node-fetch
is missing a lot of functionality. - Treats non-200 status codes as errors.
- Retries failed requests.
- Timeout support.
- Instances with custom defaults.
- Uses functions instead of properties for the body methods.
.json()
is clearer than.json
. See: mikeal/r2#22 - Better docs.
- Actively maintained (Although it's early, I do intend to actively maintain it). The last commit of
r2
was in May. - Many cool things planned for the future 😎
from ky.
@borisrorsvort I first started this project more than a year ago as an experiment to see how I could reimagine Got if it were built for the browser and based on Fetch. It's solely inspired by Got and Fetch. I only just recently had the time to finish it up and publish it.
It's not clear what libs you're referring to, but if you can share, I can elaborate more. If you mean r2
, I had not seen it before it was mentioned here, but it's also clearly not maintained anymore, so trying to contribute to it would not be very productive.
without fearing it gets abandonned next year?
I have 1K+ npm packages and I actively maintain them all. I've been doing open source for many years and I don't see that changing. I'm in for the long haul. I'm supported by the community to work on open source full-time. I created Got in early 2014 and it's still actively maintained. Ky also has another maintainer and hopefully even more additional maintainers in the future. I hope this addresses your concerns.
from ky.
We'll add a comparison table later on when Ky is more mature.
from ky.
Aside from comparaison table, if you think these differences are better, why not discussing them between library makers and choose one existing one and make it stronger & reliable lib. So that everybody can commit and improve without fearing it gets abandonned next year? Some libs are much older and their makers dont have @sindresorhus exposure, though this lib is heavily inspired by them.
from ky.
There is https://github.com/elbywan/wretch for instance .
My comment wasn't in no way intended to question the quality of your work which I deeply respect but more as a general remark about the js ecosystem.
from ky.
It's an early release. There's no major difference yet, but soon there'll be many useful features which r2
doesn't provide.
from ky.
@sindresorhus r2
is built for browsers too. It uses node-fetch
as a polyfill.
from ky.
@szmarczak You're right. I only read the first part of the text. Updated.
from ky.
There is elbywan/wretch for instance.
Its overly chainable API would be a dealbreaker for me personally. I don't see anyway they would change that.
My comment wasn't in no way intended to question the quality of your work which I deeply respect but more as a general remark about the js ecosystem.
I did not take it as that :) I just wanted to elaborate on why Ky will not end up being abandoned like a lot of projects in the JS ecosystem, which I totally agree is a big problem.
from ky.
One of the most significant differences is latest browsers support by default.
from ky.
Related Issues (20)
- How to abort retry before hitting the retry limit?
- Cannot use import statement outside a module, Jest HOT 1
- Types for headers HOT 2
- How to handle HTTP Delete Method (204) with ky?
- [BUG] When Response is a string(not valid JSON), `json` method occurs error
- Cannot find module 'undici-types' or its corresponding type declarations
- ky response is an empty string sometimes HOT 2
- response.clone(...).arrayBuffer is not a function
- Content-Type detection HOT 3
- In Next.js app: Only absolute URLs are supported HOT 1
- Compatibility issue with Cloudflare Worker HOT 2
- FormData & Files Encoding
- Why I keep getting HTTPError when the throwHttpErrors is already set to `false` HOT 2
- Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'headers') HOT 1
- beforeError hook isn't called on 500 responses HOT 2
- how to send binary data? HOT 1
- Error: unsupported BodyInit type
- retry not working? HOT 1
- HTTPError json as unknown/type
- extend: append to prefixUrl HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ky.