Socket
Socket
Sign inDemoInstall

select-files

Package Overview
Dependencies
0
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    select-files

Virtually creates a file input element (), triggers it and returns selected files.


Version published
Weekly downloads
1.8K
increased by0.33%
Maintainers
1
Install size
21.4 kB
Created
Weekly downloads
 

Readme

Source

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.

Keywords

FAQs

Last updated on 07 May 2020

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc