Node.js ky Tiny HTTP Client Library Based on Fetch API Full Tutorial With Examples in TypeScript Full Project For Beginners

 

 

Install

$ npm install ky
Download
CDN

 

 

Usage

 

import ky from 'ky';

const json = await ky.post('https://example.com', {json: {foo: true}}).json();

console.log(json);
//=> `{data: '🦄'}`

 

 

import ky from 'ky';

(async () => {
    const parsed = await ky('https://example.com', {
        retry: {
            limit: 10,
            methods: ['get'],
            statusCodes: [413]
        }
    }).json();
})();

Leave a Reply