Skip to main content
The Deno 2 Release Candidate is here
Learn more

url-to-file

CI/CD npm version semantic-release

A utility to convert url to file.

Install

Install via npm or yarn.

npm i -D url-to-file
yarn add url-to-file

API

fetchFile

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',
})