sf
select-files
npm i select-files
sf

select-files

Virtually creates a file input element (<input type="file" />), triggers it and returns selected files.

by Vitor L Cavalcanti

1.0.1 (see all)License:MITTypeScript:Built-In
npm i select-files
Readme

selectFiles

Build Status License Library minified size Library minified + gzipped size

Virtually creates a file input element (<input type="file" />), triggers it and returns selected files.

import selectFiles from 'select-files';

selectFiles({ accept: 'image/*', capture: 'camera' }).then(files => {
  // ...
});

Installation

This library is published in the NPM registry and can be installed using any compatible package manager.

npm install select-files --save

# For Yarn, use the command below.
yarn add select-files

Installation from CDN

This module has an UMD bundle available through JSDelivr and Unpkg CDNs.

<!-- For UNPKG use the code below. -->
<script src="https://unpkg.com/select-files"></script>

<!-- For JSDelivr use the code below. -->
<script src="https://cdn.jsdelivr.net/npm/select-files"></script>

<script>
  // UMD module is exposed through the "selectFiles" global function.
  selectFiles({ multiple: true }).then(files => {
    console.log(files);
  });
</script>

Documentation

Documentation generated from source files by Typedoc.

License

Released under MIT License.

Downloads/wk

1.1K

GitHub Stars

12

LAST COMMIT

3yrs ago

MAINTAINERS

1

CONTRIBUTORS

0

OPEN ISSUES

0

OPEN PRs

12
VersionTagPublished
1.0.1
latest
3yrs ago
No alternatives found
No tutorials found
Add a tutorial
No dependencies found

Rate & Review

100
No reviews found
Be the first to rate