file-select-dialog
Directly call file select dialog to JavaScript.
Get Back Promise File or FileList object.
No more hacky hiding of <input type="file">
elements.
Feature
- Supports ES6 Modules
- Pure Typescript
- Promise
- No dependencies, Optimization, Super slim size
- Modern browser support only
- Supports selecting multiple files and the file type accepts
Install
yarn add file-select-dialog
or
npm i file-select-dialog
import like this.
import { fileDialog } from 'file-select-dialog'
Examples
Get a File object by default.
const onClick = async () => {
const file = await fileDialog()
}
Get a FileList object when parameters of multiple
is true.
const onClick = async () => {
const fileList = await fileDialog({ multiple: true })
}
LICENSE
MIT