Prompt the user to select files, then pass them to a callback.
npm install choose-fileschoose-files

Prompt the user to select files, then pass the [File] objects to a callback.
If the user cancels file selection, an empty Array is returned.
Works in modern browsers, Cordova, Electron, etc.
---
``js
import chooseFiles from 'choose-files';
chooseFiles( files => {
// files is an Array of File objects
// Example - print filenames:
let names = files.map( file => file.name);
console.log(names);
});
``
---
BSD 3-Clause
[File]: https://developer.mozilla.org/en-US/docs/Web/API/File