{"_id":"@smeijer/ky","_rev":"9-a1c22ddf7d5da30b910248db82515ac1","name":"@smeijer/ky","dist-tags":{"latest":"1.8.2"},"versions":{"0.33.3-pre.1":{"name":"@smeijer/ky","version":"0.33.3-pre.1","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@0.33.3-pre.1","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/sindresorhus/ky#readme","bugs":{"url":"https://github.com/sindresorhus/ky/issues"},"xo":{"envs":["browser"],"rules":{"unicorn/filename-case":"off","@typescript-eslint/ban-ts-comment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/naming-convention":"off","@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"},"globals":["globalThis"]},"ava":{"require":["./test/_require.ts"],"extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm"]},"nyc":{"exclude":["**/test/**"],"reporter":["text","html","lcov"],"extension":[".ts"]},"dist":{"shasum":"d1244c78f5c8ad704489b2acd8babd06b850073d","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-0.33.3-pre.1.tgz","fileCount":5,"integrity":"sha512-ikHhSOxWqneJgH6WPUGXYy/tkShRoIE/Zsf6mUPFJoXq2JGxPy0497nnDZwP0IN4bBEwbiUaBUIzvKoZGqQJSA==","signatures":[{"sig":"MEUCIQC5eQ9MVgqlF93+4nQsdyLBkRPYJcJ4gD4M9pwFTvrU0wIgdzYdOuTJprF+dXoZZzoUExNHxneyvvi4W2q8jC8uP9g=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61191},"main":"ky.cjs","type":"module","types":"ky.d.ts","module":"ky.mjs","engines":{"node":">=14.16"},"exports":{".":{"types":"./ky.d.ts","import":"./ky.mjs","require":"./ky.cjs"}},"funding":"https://github.com/sindresorhus/ky?sponsor=1","gitHead":"356d61c1534c9dc2cfb8ce1c1ff5c4832579e11b","scripts":{},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/ky.git","type":"git"},"_npmVersion":"9.5.1","description":"Tiny and elegant HTTP client based on the browser Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^5.3.0","pify":"^6.1.0","delay":"^5.0.0","busboy":"^0.3.1","del-cli":"^4.0.1","express":"^4.18.2","ts-node":"^10.8.1","raw-body":"^2.5.1","form-data":"^4.0.0","node-fetch":"^2.6.1","typescript":"^5.1.3","@types/node":"^18.11.7","body-parser":"^1.20.1","expect-type":"^0.16.0","@types/busboy":"^0.3.1","@types/express":"^4.17.14","abort-controller":"^3.0.0","@types/node-fetch":"^2.6.4","@types/body-parser":"^1.19.2","playwright-chromium":"^1.27.1","@sindresorhus/tsconfig":"^3.0.1","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_0.33.3-pre.1_1689231952500_0.9262712518824563","host":"s3://npm-registry-packages"}},"0.33.3-pre.2":{"name":"@smeijer/ky","version":"0.33.3-pre.2","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@0.33.3-pre.2","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/sindresorhus/ky#readme","bugs":{"url":"https://github.com/sindresorhus/ky/issues"},"xo":{"envs":["browser"],"rules":{"unicorn/filename-case":"off","@typescript-eslint/ban-ts-comment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/naming-convention":"off","@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"},"globals":["globalThis"]},"ava":{"require":["./test/_require.ts"],"extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm"]},"nyc":{"exclude":["**/test/**"],"reporter":["text","html","lcov"],"extension":[".ts"]},"dist":{"shasum":"4989e5a02208f2d10ae3a65a11fdfd91a3c1e77c","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-0.33.3-pre.2.tgz","fileCount":5,"integrity":"sha512-PE0VSUU70QAYym1wKsiI4MniIyGMcaz0sGloFVkMUmW8kFbHoOU0ab1Y7tL0pmPB458ElXaJUtxYB0g5rmundw==","signatures":[{"sig":"MEYCIQDsWOxWTl3KPP0wrMiKchHUUib7BF9Ev42r8m2ZJP53SQIhAL/nid0o5A6Jgq9cdTFMzqCd65yOx+QFunaDladrUci/","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61250},"main":"./ky.cjs","type":"module","types":"./ky.d.ts","module":"./ky.mjs","engines":{"node":">=14.16"},"exports":{".":{"types":"./ky.d.ts","import":"./ky.mjs","require":"./ky.cjs"}},"funding":"https://github.com/sindresorhus/ky?sponsor=1","gitHead":"356d61c1534c9dc2cfb8ce1c1ff5c4832579e11b","scripts":{},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/ky.git","type":"git"},"_npmVersion":"9.5.1","description":"Tiny and elegant HTTP client based on the browser Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^5.3.0","pify":"^6.1.0","delay":"^5.0.0","busboy":"^0.3.1","del-cli":"^4.0.1","express":"^4.18.2","ts-node":"^10.8.1","raw-body":"^2.5.1","form-data":"^4.0.0","node-fetch":"^2.6.1","typescript":"^5.1.3","@types/node":"^18.11.7","body-parser":"^1.20.1","expect-type":"^0.16.0","@types/busboy":"^0.3.1","@types/express":"^4.17.14","abort-controller":"^3.0.0","@types/node-fetch":"^2.6.4","@types/body-parser":"^1.19.2","playwright-chromium":"^1.27.1","@sindresorhus/tsconfig":"^3.0.1","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_0.33.3-pre.2_1689232241020_0.7158210893629176","host":"s3://npm-registry-packages"}},"0.33.3-pre.3":{"name":"@smeijer/ky","version":"0.33.3-pre.3","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@0.33.3-pre.3","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/sindresorhus/ky#readme","bugs":{"url":"https://github.com/sindresorhus/ky/issues"},"xo":{"envs":["browser"],"rules":{"unicorn/filename-case":"off","@typescript-eslint/ban-ts-comment":"off","@typescript-eslint/no-unsafe-call":"off","@typescript-eslint/no-unsafe-return":"off","@typescript-eslint/naming-convention":"off","@typescript-eslint/no-unsafe-argument":"off","@typescript-eslint/no-unsafe-assignment":"off"},"globals":["globalThis"]},"ava":{"require":["./test/_require.ts"],"extensions":{"ts":"module"},"nodeArguments":["--loader=ts-node/esm"]},"nyc":{"exclude":["**/test/**"],"reporter":["text","html","lcov"],"extension":[".ts"]},"dist":{"shasum":"491728412474dcc9bf1a7db47a50c97dd20f5159","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-0.33.3-pre.3.tgz","fileCount":5,"integrity":"sha512-ful4mxPgSBuCIjNFSthciQ6bheu8Ry2aG5EiEBkezE5YwYrQZcSQaPCibQ1XkL4L4Y3AiSL8i8eIuLB/AAlFWw==","signatures":[{"sig":"MEUCIQDzMrcZq4SRlWIKXFR3tY5hYFB8A6Yo2ytUDbPncjoSBgIgNSqFP1qJSx4gNz0TMjebJnGYtkFIYaTV8ViElGpabdE=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":61274},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.mjs","engines":{"node":">=14.16"},"exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.cjs"}},"funding":"https://github.com/sindresorhus/ky?sponsor=1","gitHead":"356d61c1534c9dc2cfb8ce1c1ff5c4832579e11b","scripts":{},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/sindresorhus/ky.git","type":"git"},"_npmVersion":"9.5.1","description":"Tiny and elegant HTTP client based on the browser Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.54.2","ava":"^5.3.0","pify":"^6.1.0","delay":"^5.0.0","busboy":"^0.3.1","del-cli":"^4.0.1","express":"^4.18.2","ts-node":"^10.8.1","raw-body":"^2.5.1","form-data":"^4.0.0","node-fetch":"^2.6.1","typescript":"^5.1.3","@types/node":"^18.11.7","body-parser":"^1.20.1","expect-type":"^0.16.0","@types/busboy":"^0.3.1","@types/express":"^4.17.14","abort-controller":"^3.0.0","@types/node-fetch":"^2.6.4","@types/body-parser":"^1.19.2","playwright-chromium":"^1.27.1","@sindresorhus/tsconfig":"^3.0.1","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_0.33.3-pre.3_1689233128174_0.3200020161877617","host":"s3://npm-registry-packages"}},"0.33.3":{"name":"@smeijer/ky","version":"0.33.3","author":{"url":"https://meijer.ws","name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@0.33.3","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/ky","bugs":{"url":"https://github.com/smeijer/ky/issues"},"dist":{"shasum":"4aa887cb08d98f254cce222f1515544dac205b89","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-0.33.3.tgz","fileCount":24,"integrity":"sha512-qK1UT8hXAsFVc6wbE5RqEF4kvngiehoEGEEKJAle3C1/3X9lZytsgcxTSbglU8uWql4QpWUrRVAZKJvAQ5aRGw==","signatures":[{"sig":"MEUCIQD037Rerd6RdXiHE2t3SDYXHXE2oqSI+3ppzjXOBRMYrgIgbUnoYG1khG1Vq5Ht/Npw0HHLseWE0hP5Ea1UFvxiPGM=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":83414},"main":"./index.cjs","type":"module","types":"./index.d.ts","module":"./index.mjs","exports":{".":{"types":"./index.d.ts","import":"./index.mjs","require":"./index.cjs"}},"funding":"https://github.com/smeijer/ky?sponsor=1","gitHead":"356d61c1534c9dc2cfb8ce1c1ff5c4832579e11b","_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/ky.git","type":"git"},"_npmVersion":"9.5.1","description":"Tiny and elegant HTTP client based on the browser Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.16.1","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/ky_0.33.3_1689233880128_0.27651959948259863","host":"s3://npm-registry-packages"}},"1.7.2-pre":{"name":"@smeijer/ky","version":"1.7.2-pre","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@1.7.2-pre","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/ky#readme","bugs":{"url":"https://github.com/smeijer/ky/issues"},"dist":{"shasum":"9a28b2f75f224a10ce0d867bdf6351eebc9af45e","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-1.7.2-pre.tgz","fileCount":165,"integrity":"sha512-/GKiQ2UsujLRb9ryQSzXt47ON5CUeijIGc/6kpWPtdhPtDNRwt9KOvx8A/xBkXJHXKO106canaZSl+29Ya2v9A==","signatures":[{"sig":"MEUCIQCpaeECmeEVHyJbTlw7JxiY6bcl5V2GSZKAqSHjT9Az9AIgXK+e1rkfNyOeH7jY2IuU79SYq/jBPb/Up6gnJ/KpxZY=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342902},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"funding":"https://github.com/smeijer/ky?sponsor=1","gitHead":"3ba40cc6333cf1847c02c51744e22ab7c04407f5","_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/ky.git","type":"git"},"_npmVersion":"10.7.0","description":"Tiny and elegant HTTP client based on the Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","ava":"^5.3.1","tsx":"^4.16.2","pify":"^6.1.0","delay":"^6.0.0","busboy":"^1.6.0","del-cli":"^5.1.0","express":"^4.18.2","raw-body":"^2.5.2","playwright":"^1.45.3","typescript":"^5.5.4","@types/node":"^20.14.12","body-parser":"^1.20.2","expect-type":"^0.19.0","@types/busboy":"^1.5.0","@types/express":"^4.17.17","@types/body-parser":"^1.19.2","@sindresorhus/tsconfig":"^6.0.0","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_1.7.2-pre_1726081048182_0.640834578747481","host":"s3://npm-registry-packages"}},"1.7.2":{"name":"@smeijer/ky","version":"1.7.2","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@1.7.2","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/ky#readme","bugs":{"url":"https://github.com/smeijer/ky/issues"},"dist":{"shasum":"3ee73b5f605957befa65f96c801c56846eb2bfa7","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-1.7.2.tgz","fileCount":165,"integrity":"sha512-ECNcRnt8b2mqWKp6/FVNpKH/I41YthOYPdvAqXh8F1r8EV+y3gMgSw4B8uBnVMJQEeJCetEkSMV5hp8ByxxiMg==","signatures":[{"sig":"MEQCIDymPS19uMABznxq02NvKFIyrTHI6cOVTWieQL2tD6P+AiBUF+j3FpnfNfPPb4gQqIVgYmKheyomCLUafEMVd7Q3sQ==","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":342961},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"funding":"https://github.com/smeijer/ky?sponsor=1","gitHead":"3ba40cc6333cf1847c02c51744e22ab7c04407f5","_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/ky.git","type":"git"},"_npmVersion":"10.7.0","description":"Tiny and elegant HTTP client based on the Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","ava":"^5.3.1","tsx":"^4.16.2","pify":"^6.1.0","delay":"^6.0.0","busboy":"^1.6.0","del-cli":"^5.1.0","express":"^4.18.2","raw-body":"^2.5.2","playwright":"^1.45.3","typescript":"^5.5.4","@types/node":"^20.14.12","body-parser":"^1.20.2","expect-type":"^0.19.0","@types/busboy":"^1.5.0","@types/express":"^4.17.17","@types/body-parser":"^1.19.2","@sindresorhus/tsconfig":"^6.0.0","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_1.7.2_1726081954336_0.4515989276206289","host":"s3://npm-registry-packages"}},"1.7.2-pre.1":{"name":"@smeijer/ky","version":"1.7.2-pre.1","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@1.7.2-pre.1","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/ky#readme","bugs":{"url":"https://github.com/smeijer/ky/issues"},"dist":{"shasum":"81666ce3a893edf9167dd0fa65e96e3f97dea1cd","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-1.7.2-pre.1.tgz","fileCount":165,"integrity":"sha512-JHjXip8VvvIIZwA+s6QNK8IgoGwh9/pAFRZYdcJrAy1jhinA6EBshdDFci5/Gaw6RLmO6bJT3h9QR6/2w7RWog==","signatures":[{"sig":"MEUCIQDpzjrwRBmqa6bkB9ejBCERoDq2F/ferR50FSvudNf64wIgdzIIcenMZb5FLWoYap0b4dp5fLogpMDaVyYn9v+8fYw=","keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA"}],"unpackedSize":316049},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"funding":"https://github.com/smeijer/ky?sponsor=1","gitHead":"3ba40cc6333cf1847c02c51744e22ab7c04407f5","_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/ky.git","type":"git"},"_npmVersion":"10.7.0","description":"Tiny and elegant HTTP client based on the Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"18.20.4","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","ava":"^5.3.1","tsx":"^4.16.2","pify":"^6.1.0","delay":"^6.0.0","busboy":"^1.6.0","del-cli":"^5.1.0","express":"^4.18.2","raw-body":"^2.5.2","playwright":"^1.45.3","typescript":"^5.5.4","@types/node":"^20.14.12","body-parser":"^1.20.2","expect-type":"^0.19.0","@types/busboy":"^1.5.0","@types/express":"^4.17.17","@types/body-parser":"^1.19.2","@sindresorhus/tsconfig":"^6.0.0","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_1.7.2-pre.1_1726082941938_0.06768614684480001","host":"s3://npm-registry-packages"}},"1.8.1":{"name":"@smeijer/ky","version":"1.8.1","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","_id":"@smeijer/ky@1.8.1","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"homepage":"https://github.com/smeijer/ky#readme","bugs":{"url":"https://github.com/smeijer/ky/issues"},"dist":{"shasum":"c651de36acf42a036b3379c3affe9069e9f3b00d","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-1.8.1.tgz","fileCount":173,"integrity":"sha512-YKdBBngmoSbaWy8HfYT0F1f0txHFSjCPTALQLxYaNKDiKY5v3Xmbpbk8oS9gBy5q83PeR0gEUHeA+x0rLcRY7Q==","signatures":[{"sig":"MEYCIQCCFd32TbJI3F5ZaJxK7yjPoLr/DWeCyOrDmv+pTkSz3gIhAJYUAz8UPAG2tmIzE26t9a9VtClAuPB3hQ1YrLaBYTJz","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":345395},"main":"./dist/commonjs/index.js","tshy":{"exports":{".":"./src/index.ts","./package.json":"./package.json"}},"type":"module","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","engines":{"node":">=18"},"exports":{".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}},"./package.json":"./package.json"},"funding":"https://github.com/smeijer/ky?sponsor=1","gitHead":"916f8248b8ade9bbd236a27eb73f2d491642e285","_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"repository":{"url":"git+https://github.com/smeijer/ky.git","type":"git"},"_npmVersion":"10.8.2","description":"Tiny and elegant HTTP client based on the Fetch API","directories":{},"sideEffects":false,"_nodeVersion":"20.19.2","_hasShrinkwrap":false,"devDependencies":{"xo":"^0.58.0","ava":"^5.3.1","tsx":"^4.16.2","pify":"^6.1.0","delay":"^6.0.0","busboy":"^1.6.0","del-cli":"^5.1.0","express":"^4.18.2","raw-body":"^2.5.2","playwright":"^1.45.3","typescript":"^5.5.4","@types/node":"^20.14.12","body-parser":"^1.20.2","expect-type":"^0.19.0","@types/busboy":"^1.5.0","@types/express":"^4.17.17","@types/body-parser":"^1.19.2","jest-leak-detector":"^29.7.0","@sindresorhus/tsconfig":"^6.0.0","@type-challenges/utils":"^0.1.1"},"_npmOperationalInternal":{"tmp":"tmp/ky_1.8.1_1749537265819_0.33574829642886983","host":"s3://npm-registry-packages-npm-production"}},"1.8.2":{"name":"@smeijer/ky","version":"1.8.2","description":"Tiny and elegant HTTP client based on the Fetch API","license":"MIT","repository":{"type":"git","url":"git+https://github.com/smeijer/ky.git"},"funding":"https://github.com/smeijer/ky?sponsor=1","author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"type":"module","sideEffects":false,"engines":{"node":">=18"},"keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"devDependencies":{"@sindresorhus/tsconfig":"^6.0.0","@type-challenges/utils":"^0.1.1","@types/body-parser":"^1.19.2","@types/busboy":"^1.5.0","@types/express":"^4.17.17","@types/node":"^20.14.12","ava":"^5.3.1","body-parser":"^1.20.2","busboy":"^1.6.0","del-cli":"^5.1.0","delay":"^6.0.0","expect-type":"^0.19.0","express":"^4.18.2","jest-leak-detector":"^29.7.0","pify":"^6.1.0","playwright":"^1.45.3","raw-body":"^2.5.2","tsx":"^4.16.2","typescript":"^5.5.4","xo":"^0.58.0"},"tshy":{"exports":{"./package.json":"./package.json",".":"./src/index.ts"}},"exports":{"./package.json":"./package.json",".":{"import":{"types":"./dist/esm/index.d.ts","default":"./dist/esm/index.js"},"require":{"types":"./dist/commonjs/index.d.ts","default":"./dist/commonjs/index.js"}}},"main":"./dist/commonjs/index.js","types":"./dist/commonjs/index.d.ts","module":"./dist/esm/index.js","_id":"@smeijer/ky@1.8.2","gitHead":"d5710c448970d5f698b1797e9cc6271514ba0987","bugs":{"url":"https://github.com/smeijer/ky/issues"},"homepage":"https://github.com/smeijer/ky#readme","_nodeVersion":"20.19.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-REyW3+akse8fS2rRth5OKtWoYsvDO0APQ8JeLnDzx52CXEzw69gstPPv9Lz4yA7BYXMokopo4R5fvcl0CVAsoQ==","shasum":"a1b29bb5f8f74296e889df85e7f355bceb8ce668","tarball":"https://registry.npmjs.org/@smeijer/ky/-/ky-1.8.2.tgz","fileCount":173,"unpackedSize":346589,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQDkTmsZY6ECX1i3kmNnEZ/hHItFy/w/R81+BbFfAmDL5gIgWfRsdmxwmrrnbRrvjjrcCUM5STn7XxZJ/arZC4+uf7o="}]},"_npmUser":{"name":"smeijer","email":"stephan.meijer@gmail.com"},"directories":{},"maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/ky_1.8.2_1752820625021_0.6194962719401302"},"_hasShrinkwrap":false}},"time":{"created":"2023-07-13T07:05:52.428Z","modified":"2025-07-18T06:37:05.446Z","0.33.3-pre.1":"2023-07-13T07:05:52.650Z","0.33.3-pre.2":"2023-07-13T07:10:41.236Z","0.33.3-pre.3":"2023-07-13T07:25:28.360Z","0.33.3":"2023-07-13T07:38:00.331Z","1.7.2-pre":"2024-09-11T18:57:28.400Z","1.7.2":"2024-09-11T19:12:34.523Z","1.7.2-pre.1":"2024-09-11T19:29:02.305Z","1.8.1":"2025-06-10T06:34:26.004Z","1.8.2":"2025-07-18T06:37:05.272Z"},"bugs":{"url":"https://github.com/smeijer/ky/issues"},"author":{"name":"Stephan Meijer","email":"stephan.meijer@gmail.com"},"license":"MIT","homepage":"https://github.com/smeijer/ky#readme","keywords":["fetch","request","requests","http","https","fetching","get","url","curl","wget","net","network","ajax","api","rest","xhr","browser","got","axios","node-fetch"],"repository":{"type":"git","url":"git+https://github.com/smeijer/ky.git"},"description":"Tiny and elegant HTTP client based on the Fetch API","maintainers":[{"name":"smeijer","email":"stephan.meijer@gmail.com"}],"readme":"> This is a fork of ky to add common-js support. See [smeijer/ky](https://github.com/smeijer/ky) for the code that builds this package, or [sindresorhus/ky](https://github.com/sindresorhus/ky) for the original source.\n\n<div align=\"center\">\n\t<br>\n\t<div>\n\t\t<img width=\"600\" height=\"600\" src=\"media/logo.svg\" alt=\"ky\">\n\t</div>\n\t<br>\n\t<br>\n\t<br>\n</div>\n\n> Ky is a tiny and elegant HTTP client based on the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch)\n\n[![Coverage Status](https://codecov.io/gh/sindresorhus/ky/branch/main/graph/badge.svg)](https://codecov.io/gh/sindresorhus/ky)\n[![](https://badgen.net/bundlephobia/minzip/ky)](https://bundlephobia.com/result?p=ky)\n\nKy targets [modern browsers](#browser-support), Node.js, Bun, and Deno.\n\nIt's just a tiny package with no dependencies.\n\n## Benefits over plain `fetch`\n\n- Simpler API\n- Method shortcuts (`ky.post()`)\n- Treats non-2xx status codes as errors (after redirects)\n- Retries failed requests\n- JSON option\n- Timeout support\n- URL prefix option\n- Instances with custom defaults\n- Hooks\n- TypeScript niceties (e.g. `.json()` supports generics and defaults to `unknown`, not `any`)\n\n## Install\n\n```sh\nnpm install ky\n```\n\n###### CDN\n\n- [jsdelivr](https://cdn.jsdelivr.net/npm/ky/+esm)\n- [unpkg](https://unpkg.com/ky)\n- [esm.sh](https://esm.sh/ky)\n\n## Usage\n\n```js\nimport ky from 'ky';\n\nconst json = await ky.post('https://example.com', {json: {foo: true}}).json();\n\nconsole.log(json);\n//=> {data: '🦄'}\n```\n\nWith plain `fetch`, it would be:\n\n```js\nclass HTTPError extends Error {}\n\nconst response = await fetch('https://example.com', {\n\tmethod: 'POST',\n\tbody: JSON.stringify({foo: true}),\n\theaders: {\n\t\t'content-type': 'application/json'\n\t}\n});\n\nif (!response.ok) {\n\tthrow new HTTPError(`Fetch error: ${response.statusText}`);\n}\n\nconst json = await response.json();\n\nconsole.log(json);\n//=> {data: '🦄'}\n```\n\nIf you are using [Deno](https://github.com/denoland/deno), import Ky from a URL. For example, using a CDN:\n\n```js\nimport ky from 'https://esm.sh/ky';\n```\n\n## API\n\n### ky(input, options?)\n\nThe `input` and `options` are the same as [`fetch`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch), with additional `options` available (see below).\n\nReturns a [`Response` object](https://developer.mozilla.org/en-US/docs/Web/API/Response) with [`Body` methods](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API/Using_Fetch#body) added for convenience. So you can, for example, call `ky.get(input).json()` directly without having to await the `Response` first. When called like that, an appropriate `Accept` header will be set depending on the body method used. Unlike the `Body` methods of `window.Fetch`, these will throw an `HTTPError` if the response status is not in the range of `200...299`. Also, `.json()` will return an empty string if body is empty or the response status is `204` instead of throwing a parse error due to an empty body.\n\n```js\nimport ky from 'ky';\n\nconst user = await ky('/api/user').json();\n\nconsole.log(user);\n```\n\n⌨️ **TypeScript:** Accepts an optional [type parameter](https://www.typescriptlang.org/docs/handbook/2/generics.html), which defaults to [`unknown`](https://www.typescriptlang.org/docs/handbook/2/functions.html#unknown), and is passed through to the return type of `.json()`.\n\n```ts\nimport ky from 'ky';\n\n// user1 is unknown\nconst user1 = await ky('/api/users/1').json();\n// user2 is a User\nconst user2 = await ky<User>('/api/users/2').json();\n// user3 is a User\nconst user3 = await ky('/api/users/3').json<User>();\n\nconsole.log([user1, user2, user3]);\n```\n\n### ky.get(input, options?)\n### ky.post(input, options?)\n### ky.put(input, options?)\n### ky.patch(input, options?)\n### ky.head(input, options?)\n### ky.delete(input, options?)\n\nSets `options.method` to the method name and makes a request.\n\n⌨️ **TypeScript:** Accepts an optional type parameter for use with JSON responses (see [`ky()`](#kyinput-options)).\n\n#### input\n\nType: `string` | `URL` | `Request`\n\nSame as [`fetch` input](https://developer.mozilla.org/en-US/docs/Web/API/Request/Request#input).\n\nWhen using a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) instance as `input`, any URL altering options (such as `prefixUrl`) will be ignored.\n\n#### options\n\nType: `object`\n\nSame as [`fetch` options](https://developer.mozilla.org/en-US/docs/Web/API/fetch#options), plus the following additional options:\n\n##### method\n\nType: `string`\\\nDefault: `'get'`\n\nHTTP method used to make the request.\n\nInternally, the standard methods (`GET`, `POST`, `PUT`, `PATCH`, `HEAD` and `DELETE`) are uppercased in order to avoid server errors due to case sensitivity.\n\n##### json\n\nType: `object` and any other value accepted by [`JSON.stringify()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/stringify)\n\nShortcut for sending JSON. Use this instead of the `body` option. Accepts any plain object or value, which will be `JSON.stringify()`'d and sent in the body with the correct header set.\n\n##### searchParams\n\nType: `string | object<string, string | number | boolean> | Array<Array<string | number | boolean>> | URLSearchParams`\\\nDefault: `''`\n\nSearch parameters to include in the request URL. Setting this will override all existing search parameters in the input URL.\n\nAccepts any value supported by [`URLSearchParams()`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams/URLSearchParams).\n\n##### prefixUrl\n\nType: `string | URL`\n\nA prefix to prepend to the `input` URL when making the request. It can be any valid URL, either relative or absolute. A trailing slash `/` is optional and will be added automatically, if needed, when it is joined with `input`. Only takes effect when `input` is a string. The `input` argument cannot start with a slash `/` when using this option.\n\nUseful when used with [`ky.extend()`](#kyextenddefaultoptions) to create niche-specific Ky-instances.\n\n```js\nimport ky from 'ky';\n\n// On https://example.com\n\nconst response = await ky('unicorn', {prefixUrl: '/api'});\n//=> 'https://example.com/api/unicorn'\n\nconst response2 = await ky('unicorn', {prefixUrl: 'https://cats.com'});\n//=> 'https://cats.com/unicorn'\n```\n\nNotes:\n - After `prefixUrl` and `input` are joined, the result is resolved against the [base URL](https://developer.mozilla.org/en-US/docs/Web/API/Node/baseURI) of the page (if any).\n - Leading slashes in `input` are disallowed when using this option to enforce consistency and avoid confusion about how the `input` URL is handled, given that `input` will not follow the normal URL resolution rules when `prefixUrl` is being used, which changes the meaning of a leading slash.\n\n##### retry\n\nType: `object | number`\\\nDefault:\n- `limit`: `2`\n- `methods`: `get` `put` `head` `delete` `options` `trace`\n- `statusCodes`: [`408`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/408) [`413`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413) [`429`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429) [`500`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500) [`502`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/502) [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) [`504`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/504)\n- `afterStatusCodes`: [`413`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/413), [`429`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/429), [`503`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503)\n- `maxRetryAfter`: `undefined`\n- `backoffLimit`: `undefined`\n- `delay`: `attemptCount => 0.3 * (2 ** (attemptCount - 1)) * 1000`\n\nAn object representing `limit`, `methods`, `statusCodes`, `afterStatusCodes`, and `maxRetryAfter` fields for maximum retry count, allowed methods, allowed status codes, status codes allowed to use the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time, and maximum [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) time.\n\nIf `retry` is a number, it will be used as `limit` and other defaults will remain in place.\n\nIf the response provides an HTTP status contained in `afterStatusCodes`, Ky will wait until the date, timeout, or timestamp given in the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header has passed to retry the request. If `Retry-After` is missing, the non-standard [`RateLimit-Reset`](https://www.ietf.org/archive/id/draft-polli-ratelimit-headers-05.html#section-3.3) header is used in its place as a fallback. If the provided status code is not in the list, the [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header will be ignored.\n\nIf `maxRetryAfter` is set to `undefined`, it will use `options.timeout`. If [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) header is greater than `maxRetryAfter`, it will use `maxRetryAfter`.\n\nThe `backoffLimit` option is the upper limit of the delay per retry in milliseconds.\nTo clamp the delay, set `backoffLimit` to 1000, for example.\nBy default, the delay is calculated with `0.3 * (2 ** (attemptCount - 1)) * 1000`. The delay increases exponentially.\n\nThe `delay` option can be used to change how the delay between retries is calculated. The function receives one parameter, the attempt count, starting at `1`.\n\nRetries are not triggered following a [timeout](#timeout).\n\n```js\nimport ky from 'ky';\n\nconst json = await ky('https://example.com', {\n\tretry: {\n\t\tlimit: 10,\n\t\tmethods: ['get'],\n\t\tstatusCodes: [413],\n\t\tbackoffLimit: 3000\n\t}\n}).json();\n```\n\n##### timeout\n\nType: `number | false`\\\nDefault: `10000`\n\nTimeout in milliseconds for getting a response, including any retries. Can not be greater than 2147483647.\nIf set to `false`, there will be no timeout.\n\n##### hooks\n\nType: `object<string, Function[]>`\\\nDefault: `{beforeRequest: [], beforeRetry: [], afterResponse: []}`\n\nHooks allow modifications during the request lifecycle. Hook functions may be async and are run serially.\n\n###### hooks.beforeRequest\n\nType: `Function[]`\\\nDefault: `[]`\n\nThis hook enables you to modify the request right before it is sent. Ky will make no further changes to the request after this. The hook function receives `request` and `options` as arguments. You could, for example, modify the `request.headers` here.\n\nThe hook can return a [`Request`](https://developer.mozilla.org/en-US/docs/Web/API/Request) to replace the outgoing request, or return a [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response) to completely avoid making an HTTP request. This can be used to mock a request, check an internal cache, etc. An **important** consideration when returning a request or response from this hook is that any remaining `beforeRequest` hooks will be skipped, so you may want to only return them from the last hook.\n\n```js\nimport ky from 'ky';\n\nconst api = ky.extend({\n\thooks: {\n\t\tbeforeRequest: [\n\t\t\trequest => {\n\t\t\t\trequest.headers.set('X-Requested-With', 'ky');\n\t\t\t}\n\t\t]\n\t}\n});\n\nconst response = await api.get('https://example.com/api/users');\n```\n\n###### hooks.beforeRetry\n\nType: `Function[]`\\\nDefault: `[]`\n\nThis hook enables you to modify the request right before retry. Ky will make no further changes to the request after this. The hook function receives an object with the normalized request and options, an error instance, and the retry count. You could, for example, modify `request.headers` here.\n\nIf the request received a response, the error will be of type `HTTPError` and the `Response` object will be available at `error.response`. Be aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will not be an instance of `HTTPError`.\n\nYou can prevent Ky from retrying the request by throwing an error. Ky will not handle it in any way and the error will be propagated to the request initiator. The rest of the `beforeRetry` hooks will not be called in this case. Alternatively, you can return the [`ky.stop`](#kystop) symbol to do the same thing but without propagating an error (this has some limitations, see `ky.stop` docs for details).\n\n```js\nimport ky from 'ky';\n\nconst response = await ky('https://example.com', {\n\thooks: {\n\t\tbeforeRetry: [\n\t\t\tasync ({request, options, error, retryCount}) => {\n\t\t\t\tconst token = await ky('https://example.com/refresh-token');\n\t\t\t\trequest.headers.set('Authorization', `token ${token}`);\n\t\t\t}\n\t\t]\n\t}\n});\n```\n\n###### hooks.beforeError\n\nType: `Function[]`\\\nDefault: `[]`\n\nThis hook enables you to modify the `HTTPError` right before it is thrown. The hook function receives a `HTTPError` as an argument and should return an instance of `HTTPError`.\n\n```js\nimport ky from 'ky';\n\nawait ky('https://example.com', {\n\thooks: {\n\t\tbeforeError: [\n\t\t\terror => {\n\t\t\t\tconst {response} = error;\n\t\t\t\tif (response && response.body) {\n\t\t\t\t\terror.name = 'GitHubError';\n\t\t\t\t\terror.message = `${response.body.message} (${response.status})`;\n\t\t\t\t}\n\n\t\t\t\treturn error;\n\t\t\t}\n\t\t]\n\t}\n});\n```\n\n###### hooks.afterResponse\n\nType: `Function[]`\\\nDefault: `[]`\n\nThis hook enables you to read and optionally modify the response. The hook function receives normalized request, options, and a clone of the response as arguments. The return value of the hook function will be used by Ky as the response object if it's an instance of [`Response`](https://developer.mozilla.org/en-US/docs/Web/API/Response).\n\n```js\nimport ky from 'ky';\n\nconst response = await ky('https://example.com', {\n\thooks: {\n\t\tafterResponse: [\n\t\t\t(_request, _options, response) => {\n\t\t\t\t// You could do something with the response, for example, logging.\n\t\t\t\tlog(response);\n\n\t\t\t\t// Or return a `Response` instance to overwrite the response.\n\t\t\t\treturn new Response('A different response', {status: 200});\n\t\t\t},\n\n\t\t\t// Or retry with a fresh token on a 403 error\n\t\t\tasync (request, options, response) => {\n\t\t\t\tif (response.status === 403) {\n\t\t\t\t\t// Get a fresh token\n\t\t\t\t\tconst token = await ky('https://example.com/token').text();\n\n\t\t\t\t\t// Retry with the token\n\t\t\t\t\trequest.headers.set('Authorization', `token ${token}`);\n\n\t\t\t\t\treturn ky(request);\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n});\n```\n\n##### throwHttpErrors\n\nType: `boolean`\\\nDefault: `true`\n\nThrow an `HTTPError` when, after following redirects, the response has a non-2xx status code. To also throw for redirects instead of following them, set the [`redirect`](https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch#Parameters) option to `'manual'`.\n\nSetting this to `false` may be useful if you are checking for resource availability and are expecting error responses.\n\nNote: If `false`, error responses are considered successful and the request will not be retried.\n\n##### onDownloadProgress\n\nType: `Function`\n\nDownload progress event handler.\n\nThe function receives these arguments:\n- `progress` is an object with the these properties:\n- - `percent` is a number between 0 and 1 representing the progress percentage.\n- - `transferredBytes` is the number of bytes transferred so far.\n- - `totalBytes` is the total number of bytes to be transferred. This is an estimate and may be 0 if the total size cannot be determined.\n- `chunk` is an instance of `Uint8Array` containing the data that was sent. Note: It's empty for the first call.\n\n```js\nimport ky from 'ky';\n\nconst response = await ky('https://example.com', {\n\tonDownloadProgress: (progress, chunk) => {\n\t\t// Example output:\n\t\t// `0% - 0 of 1271 bytes`\n\t\t// `100% - 1271 of 1271 bytes`\n\t\tconsole.log(`${progress.percent * 100}% - ${progress.transferredBytes} of ${progress.totalBytes} bytes`);\n\t}\n});\n```\n\n##### onUploadProgress\n\nType: `Function`\n\nUpload progress event handler.\n\nThe function receives these arguments:\n- `progress` is an object with the these properties:\n- - `percent` is a number between 0 and 1 representing the progress percentage.\n- - `transferredBytes` is the number of bytes transferred so far.\n- - `totalBytes` is the total number of bytes to be transferred. This is an estimate and may be 0 if the total size cannot be determined.\n- `chunk` is an instance of `Uint8Array` containing the data that was sent. Note: It's empty for the last call.\n\n```js\nimport ky from 'ky';\n\nconst response = await ky.post('https://example.com/upload', {\n\tbody: largeFile,\n\tonUploadProgress: (progress, chunk) => {\n\t\t// Example output:\n\t\t// `0% - 0 of 1271 bytes`\n\t\t// `100% - 1271 of 1271 bytes`\n\t\tconsole.log(`${progress.percent * 100}% - ${progress.transferredBytes} of ${progress.totalBytes} bytes`);\n\t}\n});\n```\n\n##### parseJson\n\nType: `Function`\\\nDefault: `JSON.parse()`\n\nUser-defined JSON-parsing function.\n\nUse-cases:\n1. Parse JSON via the [`bourne` package](https://github.com/hapijs/bourne) to protect from prototype pollution.\n2. Parse JSON with [`reviver` option of `JSON.parse()`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/JSON/parse).\n\n```js\nimport ky from 'ky';\nimport bourne from '@hapijs/bourne';\n\nconst json = await ky('https://example.com', {\n\tparseJson: text => bourne(text)\n}).json();\n```\n\n##### stringifyJson\n\nType: `Function`\\\nDefault: `JSON.stringify()`\n\nUser-defined JSON-stringifying function.\n\nUse-cases:\n1. Stringify JSON with a custom `replacer` function.\n\n```js\nimport ky from 'ky';\nimport {DateTime} from 'luxon';\n\nconst json = await ky('https://example.com', {\n\tstringifyJson: data => JSON.stringify(data, (key, value) => {\n\t\tif (key.endsWith('_at')) {\n\t\t\treturn DateTime.fromISO(value).toSeconds();\n\t\t}\n\n\t\treturn value;\n\t})\n}).json();\n```\n\n##### fetch\n\nType: `Function`\\\nDefault: `fetch`\n\nUser-defined `fetch` function.\nHas to be fully compatible with the [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) standard.\n\nUse-cases:\n1. Use custom `fetch` implementations like [`isomorphic-unfetch`](https://www.npmjs.com/package/isomorphic-unfetch).\n2. Use the `fetch` wrapper function provided by some frameworks that use server-side rendering (SSR).\n\n```js\nimport ky from 'ky';\nimport fetch from 'isomorphic-unfetch';\n\nconst json = await ky('https://example.com', {fetch}).json();\n```\n\n### ky.extend(defaultOptions)\n\nCreate a new `ky` instance with some defaults overridden with your own.\n\nIn contrast to `ky.create()`, `ky.extend()` inherits defaults from its parent.\n\nYou can pass headers as a `Headers` instance or a plain object.\n\nYou can remove a header with `.extend()` by passing the header with an `undefined` value.\nPassing `undefined` as a string removes the header only if it comes from a `Headers` instance.\n\nSimilarly, you can remove existing `hooks` entries by extending the hook with an explicit `undefined`.\n\n```js\nimport ky from 'ky';\n\nconst url = 'https://sindresorhus.com';\n\nconst original = ky.create({\n\theaders: {\n\t\trainbow: 'rainbow',\n\t\tunicorn: 'unicorn'\n\t},\n\thooks: {\n\t\tbeforeRequest: [ () => console.log('before 1') ],\n\t\tafterResponse: [ () => console.log('after 1') ],\n\t},\n});\n\nconst extended = original.extend({\n\theaders: {\n\t\trainbow: undefined\n\t},\n\thooks: {\n\t\tbeforeRequest: undefined,\n\t\tafterResponse: [ () => console.log('after 2') ],\n\t}\n});\n\nconst response = await extended(url).json();\n//=> after 1\n//=> after 2\n\nconsole.log('rainbow' in response);\n//=> false\n\nconsole.log('unicorn' in response);\n//=> true\n```\n\nYou can also refer to parent defaults by providing a function to `.extend()`.\n\n```js\nimport ky from 'ky';\n\nconst api = ky.create({prefixUrl: 'https://example.com/api'});\n\nconst usersApi = api.extend((options) => ({prefixUrl: `${options.prefixUrl}/users`}));\n\nconst response = await usersApi.get('123');\n//=> 'https://example.com/api/users/123'\n\nconst response = await api.get('version');\n//=> 'https://example.com/api/version'\n```\n\n### ky.create(defaultOptions)\n\nCreate a new Ky instance with complete new defaults.\n\n```js\nimport ky from 'ky';\n\n// On https://my-site.com\n\nconst api = ky.create({prefixUrl: 'https://example.com/api'});\n\nconst response = await api.get('users/123');\n//=> 'https://example.com/api/users/123'\n\nconst response = await api.get('/status', {prefixUrl: ''});\n//=> 'https://my-site.com/status'\n```\n\n#### defaultOptions\n\nType: `object`\n\n### ky.stop\n\nA `Symbol` that can be returned by a `beforeRetry` hook to stop the retry. This will also short circuit the remaining `beforeRetry` hooks.\n\nNote: Returning this symbol makes Ky abort and return with an `undefined` response. Be sure to check for a response before accessing any properties on it or use [optional chaining](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Operators/Optional_chaining). It is also incompatible with body methods, such as `.json()` or `.text()`, because there is no response to parse. In general, we recommend throwing an error instead of returning this symbol, as that will cause Ky to abort and then throw, which avoids these limitations.\n\nA valid use-case for `ky.stop` is to prevent retries when making requests for side effects, where the returned data is not important. For example, logging client activity to the server.\n\n```js\nimport ky from 'ky';\n\nconst options = {\n\thooks: {\n\t\tbeforeRetry: [\n\t\t\tasync ({request, options, error, retryCount}) => {\n\t\t\t\tconst shouldStopRetry = await ky('https://example.com/api');\n\t\t\t\tif (shouldStopRetry) {\n\t\t\t\t\treturn ky.stop;\n\t\t\t\t}\n\t\t\t}\n\t\t]\n\t}\n};\n\n// Note that response will be `undefined` in case `ky.stop` is returned.\nconst response = await ky.post('https://example.com', options);\n\n// Using `.text()` or other body methods is not supported.\nconst text = await ky('https://example.com', options).text();\n```\n\n### HTTPError\n\nExposed for `instanceof` checks. The error has a `response` property with the [`Response` object](https://developer.mozilla.org/en-US/docs/Web/API/Response), `request` property with the [`Request` object](https://developer.mozilla.org/en-US/docs/Web/API/Request), and `options` property with normalized options (either passed to `ky` when creating an instance with `ky.create()` or directly when performing the request).\n\nBe aware that some types of errors, such as network errors, inherently mean that a response was not received. In that case, the error will not be an instance of HTTPError and will not contain a `response` property.\n\nIf you need to read the actual response when an `HTTPError` has occurred, call the respective parser method on the response object. For example:\n\n```js\ntry {\n\tawait ky('https://example.com').json();\n} catch (error) {\n\tif (error.name === 'HTTPError') {\n\t\tconst errorJson = await error.response.json();\n\t}\n}\n```\n\n⌨️ **TypeScript:** Accepts an optional [type parameter](https://www.typescriptlang.org/docs/handbook/2/generics.html), which defaults to [`unknown`](https://www.typescriptlang.org/docs/handbook/2/functions.html#unknown), and is passed through to the return type of `error.response.json()`.\n\n### TimeoutError\n\nThe error thrown when the request times out. It has a `request` property with the [`Request` object](https://developer.mozilla.org/en-US/docs/Web/API/Request).\n\n## Tips\n\n### Sending form data\n\nSending form data in Ky is identical to `fetch`. Just pass a [`FormData`](https://developer.mozilla.org/en-US/docs/Web/API/FormData) instance to the `body` option. The `Content-Type` header will be automatically set to `multipart/form-data`.\n\n```js\nimport ky from 'ky';\n\n// `multipart/form-data`\nconst formData = new FormData();\nformData.append('food', 'fries');\nformData.append('drink', 'icetea');\n\nconst response = await ky.post(url, {body: formData});\n```\n\nIf you want to send the data in `application/x-www-form-urlencoded` format, you will need to encode the data with [`URLSearchParams`](https://developer.mozilla.org/en-US/docs/Web/API/URLSearchParams).\n\n```js\nimport ky from 'ky';\n\n// `application/x-www-form-urlencoded`\nconst searchParams = new URLSearchParams();\nsearchParams.set('food', 'fries');\nsearchParams.set('drink', 'icetea');\n\nconst response = await ky.post(url, {body: searchParams});\n```\n\n### Setting a custom `Content-Type`\n\nKy automatically sets an appropriate [`Content-Type`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Type) header for each request based on the data in the request body. However, some APIs require custom, non-standard content types, such as `application/x-amz-json-1.1`. Using the `headers` option, you can manually override the content type.\n\n```js\nimport ky from 'ky';\n\nconst json = await ky.post('https://example.com', {\n\theaders: {\n\t\t'content-type': 'application/json'\n\t},\n\tjson: {\n\t\tfoo: true\n\t},\n}).json();\n\nconsole.log(json);\n//=> {data: '🦄'}\n```\n\n### Cancellation\n\nFetch (and hence Ky) has built-in support for request cancellation through the [`AbortController` API](https://developer.mozilla.org/en-US/docs/Web/API/AbortController). [Read more.](https://developers.google.com/web/updates/2017/09/abortable-fetch)\n\nExample:\n\n```js\nimport ky from 'ky';\n\nconst controller = new AbortController();\nconst {signal} = controller;\n\nsetTimeout(() => {\n\tcontroller.abort();\n}, 5000);\n\ntry {\n\tconsole.log(await ky(url, {signal}).text());\n} catch (error) {\n\tif (error.name === 'AbortError') {\n\t\tconsole.log('Fetch aborted');\n\t} else {\n\t\tconsole.error('Fetch error:', error);\n\t}\n}\n```\n\n## FAQ\n\n#### How do I use this in Node.js?\n\nNode.js 18 and later supports `fetch` natively, so you can just use this package directly.\n\n#### How do I use this with a web app (React, Vue.js, etc.) that uses server-side rendering (SSR)?\n\nSame as above.\n\n#### How do I test a browser library that uses this?\n\nEither use a test runner that can run in the browser, like Mocha, or use [AVA](https://avajs.dev) with `ky-universal`. [Read more.](https://github.com/sindresorhus/ky-universal#faq)\n\n#### How do I use this without a bundler like Webpack?\n\nMake sure your code is running as a JavaScript module (ESM), for example by using a `<script type=\"module\">` tag in your HTML document. Then Ky can be imported directly by that module without a bundler or other tools.\n\n```html\n<script type=\"module\">\nimport ky from 'https://unpkg.com/ky/distribution/index.js';\n\nconst json = await ky('https://jsonplaceholder.typicode.com/todos/1').json();\n\nconsole.log(json.title);\n//=> 'delectus aut autem'\n</script>\n```\n\n#### How is it different from [`got`](https://github.com/sindresorhus/got)\n\nGot is maintained by the same people as Ky, so you probably want Ky instead. It's smaller, works in the browser too, and is more stable since it's built on Fetch.\n\n#### How is it different from [`axios`](https://github.com/axios/axios)?\n\nSee my answer [here](https://twitter.com/sindresorhus/status/1037763588826398720).\n\n#### How is it different from [`r2`](https://github.com/mikeal/r2)?\n\nSee my answer in [#10](https://github.com/sindresorhus/ky/issues/10).\n\n#### What does `ky` mean?\n\nIt's just a random short npm package name I managed to get. It does, however, have a meaning in Japanese:\n\n> A form of text-able slang, KY is an abbreviation for 空気読めない (kuuki yomenai), which literally translates into “cannot read the air.” It's a phrase applied to someone who misses the implied meaning.\n\n## Browser support\n\nThe latest version of Chrome, Firefox, and Safari.\n\n## Node.js support\n\nNode.js 18 and later.\n\n## Related\n\n- [fetch-extras](https://github.com/sindresorhus/fetch-extras) - Useful utilities for working with Fetch\n- [ky-hooks-change-case](https://github.com/alice-health/ky-hooks-change-case) - Ky hooks to modify cases on requests and responses of objects\n\n## Maintainers\n\n- [Sindre Sorhus](https://github.com/sindresorhus)\n- [Seth Holladay](https://github.com/sholladay)\n- [Szymon Marczak](https://github.com/szmarczak)\n","readmeFilename":"readme.md"}