文件名称:ohmyfetch:更好的提取API。 适用于节点,浏览器和工作程序
文件大小:196KB
文件格式:ZIP
更新时间:2024-04-25 17:02:54
TypeScript
:rocket: 快速开始 安装: # npm npm i ohmyfetch # yarn yarn add ohmyfetch 进口: // Universal (requires global.fetch) import { $fetch } from 'ohmyfetch' // NodeJS / Isomorphic import { $fetch } from 'ohmyfetch/node' // NodeJS / Isomorphic (CommonJS) const { $fetch } = require ( 'ohmyfetch/node' ) 扰流板 :check_mark: 解析响应 $fetch使用巧妙地解析JSON和本机值,如果无法解析则回文本 const { users } = await $fetch ( '/api/users' ) :check_mark: JSON正文 $fetch自动对请
【文件预览】:
ohmyfetch-main
----.eslintrc(62B)
----.github()
--------banner.svg(269KB)
--------workflows()
----node.js(43B)
----yarn.lock(254KB)
----src()
--------types.ts(185B)
--------base.ts(48B)
--------index.ts(524B)
--------fetch.ts(2KB)
--------error.ts(1KB)
--------node.ts(183B)
----playground()
--------index.ts(289B)
--------index.mjs(163B)
----tsconfig.json(258B)
----LICENSE(1KB)
----test()
--------index.test.ts(2KB)
----jest.config.js(93B)
----node.mjs(32B)
----README.md(4KB)
----node.d.ts(30B)
----renovate.json(37B)
----.editorconfig(224B)
----.gitignore(64B)
----CHANGELOG.md(4KB)
----.eslintignore(5B)
----package.json(1KB)