Skip to content

Commit

Permalink
chore: use ofetch and latest node-fetch-native (#4216)
Browse files Browse the repository at this point in the history
  • Loading branch information
pi0 committed Oct 3, 2023
1 parent fad4663 commit bca21a2
Show file tree
Hide file tree
Showing 4 changed files with 366 additions and 180 deletions.
4 changes: 2 additions & 2 deletions docs/.vitepress/scripts/fetch-avatars.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { fileURLToPath } from 'node:url'
import { dirname, join, resolve } from 'pathe'
import fs from 'fs-extra'
import { $fetch } from 'ohmyfetch'
import { ofetch } from 'ofetch'

const docsDir = resolve(dirname(fileURLToPath(import.meta.url)), '../..')
const pathContributors = resolve(docsDir, '.vitepress/contributor-names.json')
Expand All @@ -16,7 +16,7 @@ async function download(url: string, fileName: string) {
// eslint-disable-next-line no-console
console.log('downloading', fileName)
try {
const image = await $fetch(url, { responseType: 'arrayBuffer' })
const image = await ofetch(url, { responseType: 'arrayBuffer' })
await fs.writeFile(fileName, Buffer.from(image))
}
catch {}
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,9 @@
"if-node-version": "^1.1.1",
"lint-staged": "^13.2.3",
"magic-string": "^0.30.1",
"node-fetch-native": "^1.2.0",
"node-fetch-native": "^1.4.0",
"npm-run-all": "^4.1.5",
"ohmyfetch": "^0.4.21",
"ofetch": "^1.3.3",
"pathe": "^1.1.1",
"pnpm": "8.6.6",
"rimraf": "^5.0.1",
Expand Down

0 comments on commit bca21a2

Please sign in to comment.