🌯

APIラッパーを作るときに便利なライブラリまとめ

2024/04/05に公開

1.ky

軽量fetchライブラリ

ky('https://google.com')// GET
ky.get// GET

const Body = true
const SETTEI1 = 'jp'
const SETTEI2 = 'en'
ky.post('https://api.sugoi',{Body,SETTEI1,SETTEI2})// POST

2.ufo

軽量url変形ライブラリ

const big = '象さん'
const url = 'https://google.com'
const addpram = withQuery(url, {test:false,big})// https://google.com/?test=false&big=象さん
const encode = normalizeURL(addpram); // https://google.com/?test=false&big=%E8%B1%A1%E3%81%95%E3%82%93

あとがき

ほかにも見つけたら追記予定です。

GitHubで編集を提案

Discussion