# 分享幾個實際被用到的 library ## got [sindresorhus/got: 🌐 Human-friendly and powerful HTTP request library for Node.js](https://github.com/sindresorhus/got) > Node.js 的一個 Human-friendly 的強大 HTTP request library - [ky](https://github.com/sindresorhus/ky) 開發團隊出的一個 request library - 支援 Http/2(需要 Node.js 15.10.0 或更高版本) - 不支援瀏覽器上運行(如需在瀏覽器上運行,官方建議使用該團隊出的另一個 Library:[ky](https://github.com/sindresorhus/ky) ### 亮點: HTTP/2 support 根據官網的表,`got` 支援 HTTP/2,在 Node.js 15.10.0 以上的版本中可以使用。 ![](https://i.imgur.com/6b1r7Sf.png) ### 亮點: JSON mode Got 有一個專門的選項來處理 JSON playload。 具體的說,got 有一個會回傳 `Promise<T>` 的 `.json<T>()` 函數可以用來處理 json。 ```js import got from 'got'; const {data} = await got.post('https://httpbin.org/anything', { json: { hello: 'world' } }).json(); console.log(data); //=> {"hello": "world"} ```