ky

🌳 Tiny & elegant JavaScript HTTP client based on the browser Fetch API

MIT License

Downloads
7.7M
Stars
11.4K
Committers
108

Bot releases are visible (Hide)

ky -

Published by sindresorhus over 4 years ago

  • Add ability to remove headers using ky.extend() (#235) 70826b2

https://github.com/sindresorhus/ky/compare/v0.19.1...v0.20.0

ky -

Published by sindresorhus over 4 years ago

  • Fix the NormalizedOptions.headers TypeScript type (#243)
  • Ensure HTTPError always has a defined message (#249)
ky -

Published by sindresorhus over 4 years ago

  • Add TimeoutError and HTTPError to ky TypeScript namespace (#241) 9c9dfe9
  • Delete Content-Type header for multipart requests (#211) d547e89

https://github.com/sindresorhus/ky/compare/v0.18.0...v0.19.0

ky -

Published by sindresorhus over 4 years ago

  • Fix request cancellation on timeout (#238) 041e935
  • Add response to beforeRetry hook and change its parameter to be a single object (#201) 3f3e14d
    • Migrate:
-(request, options, error, retryCount) => {
+({request, response, options, error, retryCount}) => {

https://github.com/sindresorhus/ky/compare/v0.17.0...v0.18.0

ky -

Published by sindresorhus over 4 years ago

Breaking

  • Require Node.js 10 if you use it in Node.js 7c1d371
  • Move named exports to properties of default export (#206) cf6ca95
    • HTTPError and TimeoutError are now properties on the default export ky instead of individual named exports.
    • If you use the UMD build, you no longer need the .default property: const ky = require('ky/umd').default; → const ky = require('ky/umd');

Fixes

  • Fix retries for requests with a body (#231) 55b2535

https://github.com/sindresorhus/ky/compare/v0.16.2...v0.17.0

ky -

Published by sindresorhus over 4 years ago

  • Fix handling of falsy value with the json option (#223) b20779b

https://github.com/sindresorhus/ky/compare/v0.16.1...v0.16.2

ky -

Published by sindresorhus almost 5 years ago

  • Remove content-type header check for FormData body (#208) 2078a15

https://github.com/sindresorhus/ky/compare/v0.16.0...v0.16.1

ky -

Published by sindresorhus almost 5 years ago

Breaking

  • Hooks now always receive a Request instance as the first argument instead of the input URL, which could previously either be a string, Request, or URL (#180) c5821a7

Enhancements

  • Pass all Ky options to hooks (#188) a5c249e
  • Allow overriding the default accept headers (#200) 65f38f9
  • Add ability to stop retries in beforeRetry hooks (#198) 0bc6fb1
  • beforeRequest hooks can now return a Request instance to replace the existing request (https://github.com/sindresorhus/ky/pull/180)

Fixes

  • Avoid body method parse errors on 204 responses (#196) a1c000e
  • Fix global property lookup (#203) c0d9d2b

Docs

  • Document prefixUrl reasonings (#175) 4e05289
  • Improve example in documentation for using umd.js (#190) 3b87b93

Meta

https://github.com/sindresorhus/ky/compare/v0.15.0...v0.16.0

ky -

Published by sindresorhus about 5 years ago

  • Fix BeforeRequestHook TypeScript type (#181) 32a7007
  • Validate the input argument (#176) 68959c4

https://github.com/sindresorhus/ky/compare/v0.14.0...v0.15.0

ky -

Published by sindresorhus about 5 years ago

  • Add beforeRetry hook (#159) 4eb3677
  • Allow returning Response from a beforeRequest hook (#172) 59d36ac
  • Move globals to getters to allow them to be mocked (#153) ac07244

https://github.com/sindresorhus/ky/compare/v0.13.0...v0.14.0

ky -

Published by sindresorhus about 5 years ago

Breaking

  • Pass input & options arguments to beforeRequest & afterResponse hooks (#163) 9181aa2
 await ky('…', {
 	hooks: {
 		beforeRequest: [
-			options => {}
+			(input, options) => {}
 		]
 		afterResponse: [
-			response => {}
+			(input, options, response) => {}
 		]
 	}
 });

Enhancements

  • Make the retry option more powerful (#110) d4ddb7a
    You can now control which HTTP methods and status codes that should cause a retry.
  • Simplify the Options TypeScript type (#165) bfdc9b5
    This should make it easier to wrap Ky when using TypeScript.

https://github.com/sindresorhus/ky/compare/v0.12.0...v0.13.0

ky -

Published by sindresorhus about 5 years ago

  • Fix passing a Request instance as input (#147) 9c81d89
  • Fix the BeforeRequestHook TypeScript type (#161) 0a0427d
  • Fix the options TypeScript type (#162) 00266ea

https://github.com/sindresorhus/ky/compare/v0.11.2...v0.12.0

ky -

Published by sindresorhus about 5 years ago

  • Fix timeout regression that caused Node.js to not terminate (#145) 30450d8

https://github.com/sindresorhus/ky/compare/v0.11.1...v0.11.2

ky -

Published by sindresorhus over 5 years ago

  • Fix TypeScript 3.5 compatibility 93d2faf

https://github.com/sindresorhus/ky/compare/v0.11.0...v0.11.1

ky -

Published by sindresorhus over 5 years ago

Breaking (possibly):

  • Simplify the TypeScript types (#133) 7793c53

Enhancements:

  • Implement disabling timeouts (#127) e9c807b
  • Add onDownloadProgress option (#34) f89d796

Fixes:

  • Fix ky.extend() not inheriting its parent and add ky.create() (#128) 0a6beb1

https://github.com/sindresorhus/ky/compare/v0.10.0...v0.11.0

ky -

Published by sindresorhus over 5 years ago

Breaking (for TypeScript users only):

  • Don't export the Ky TypeScript namespace 7114ba3

Enhancements:

  • Set accept header for Ky shortcut methods (#118) afc18ea
  • Make it possible to install Ky in Node.js 8 even though it's not support (This is to re-enable Node.js 8 support in ky-universal) fcffa18

Fixes:

  • Fix regression for environments without AbortController, for example, React Native (#125) a012fd3

https://github.com/sindresorhus/ky/compare/v0.9.1...v0.10.0

ky -

Published by sindresorhus over 5 years ago

  • Fix problem with debugging timed-out requests (#122) ed17c9a
  • Fix TypeScript types to allow hooks to return a Promise (#123) bc6aa04
  • Fix TypeScript Error types (#113) 8d295b0

https://github.com/sindresorhus/ky/compare/v0.9.0...v0.9.1

ky -

Published by sindresorhus over 5 years ago

  • Fix afterResponse hook & retry not being called (#95) cd33a63
  • Improve TypeScript types for get and head methods (#87) 66ea8a7

https://github.com/sindresorhus/ky/compare/v0.8.0...v0.9.0

ky -

Published by sindresorhus over 5 years ago

  • Make the .json() method generic (#98) ce12902
  • Actually cancel the request after the timeout (#27) 8f17a13

https://github.com/sindresorhus/ky/compare/v0.7.1...v0.8.0

ky -

Published by sindresorhus over 5 years ago

  • Add ky/umd TypeScript definition (#89) 5fabe0c
  • Support running Ky in Deno (#86) 7bcea95

https://github.com/sindresorhus/ky/compare/v0.7.0...v0.7.1

Package Rankings
Top 0.62% on Npmjs.org
Top 14.85% on Deno.land
Top 3.88% on Proxy.golang.org
Top 13.52% on Repo1.maven.org
Badges
Extracted from project README
Coverage Status