Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-select-dialog

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-select-dialog

Call file select dialog programmatically

  • 1.4.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
781
decreased by-9.82%
Maintainers
1
Weekly downloads
 
Created
Source

file-select-dialog

npm version size size codecov code style: prettier Commitizen friendly semantic-release MIT License

Directly call file select dialog to JavaScript. Get Back Promise File or FileList object. No more hacky hiding of <input type="file"> elements.

Feature

  • Supports ES6 Modules
  • Pure Typescript
  • Promise
  • No dependencies, Optimization, Super slim size
  • Modern browser support only
  • Supports selecting multiple files and the file type accepts

Install

yarn add file-select-dialog
or
npm i file-select-dialog

import like this.

import { fileDialog } from 'file-select-dialog'

Examples

Demo

screenshot

Get a File object by default.

const onClick = async () => {
  const file = await fileDialog() // open file select dialog and waiting user selection then return File object. Your editor suggest File object types.
}

Get a FileList object when parameters of multiple is true.

const onClick = async () => {
  const fileList = await fileDialog({ multiple: true }) // return FileList object. Your editor suggest FileList object types.
}

LICENSE

MIT

Keywords

FAQs

Package last updated on 28 Nov 2020

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc