file-select
prompt user for selecting files. +promises, -forms
What is this?
This allows the developer to ask their app/website users for files without creating a form and a file input element.
Installation
npm i --save file-select
Usage
Using a standalone release build
HINT: Check out newest releases here!
JS ES-stage-0 a.k.a. ES-awesome
{ try const image = await const res = await req catch err }
JS ES5 / CommonJS
var req = var fileSelect = { return Promise }
API
fileSelect
options
Object
Object with options.
options.multiple
boolean
Allows multiple files selection.
options.maxFileSize
Number
Limits select size PER FILE.
options.accept
String | false
String with mime types and file extensions separated by commas.
Examples:
.jpg,.jpeg
image/jpeg,.jpeg,.jpg
image/jpeg
.pdf
.mp3