A utility to convert url to file.
Install via npm or yarn.
npm i -D url-to-file
yarn add url-to-file
Use on Deno.
import { fetchFile } from 'https://deno.land/x/url_to_file@v1.1.0/main.ts'
const file = await fetchFile('https://picsum.photos/200/300', 'image.png', {
type: 'image/png',
})
Fetch an url and return a File object.
import { fetchFile } from 'url-to-file'
const file = await fetchFile('https://picsum.photos/200/300', 'image.png', {
type: 'image/png',
})