file-open

0.1.1 • Public • Published

file-open

Opens a file from the browser.

Usage

import fileOpen from 'file-open';

const button = document.querySelector('#chooser-button');

button.addEventListener('click', async function() {
  const files = await fileOpen();

  console.log(files);
});

API

fileOpen(opts) => Promise<File[]>

  • opts.multiple Allows selection of multiple files
  • opts.accept Specifies allowed file extensions or MIME types. more

See also

License

MIT

Package Sidebar

Install

npm i file-open

Weekly Downloads

15

Version

0.1.1

License

MIT

Unpacked Size

4.35 kB

Total Files

5

Last publish

Collaborators

  • nikku