1.1.0 • Published 3 years ago

url-to-file v1.1.0

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

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