{"name":"file-selector","version":"0.1.19","description":"Convert DataTransfer object to a list of File objects","main":"./dist/index.js","module":"./dist/es5/index.js","es2015":"./dist/es2015/index.js","typings":"./dist/index.d.ts","keywords":["drag-and-drop","html5","file-api","DataTransfer","File"],"homepage":"https://github.com/react-dropzone/file-selector","license":"MIT","author":{"name":"Roland Groza","email":"rolandjitsu@gmail.com"},"repository":{"type":"git","url":"git+https://github.com/react-dropzone/file-selector.git"},"scripts":{"prebuild":"yarn run clean","build":"npm-run-all -s compile build:umd","build:umd":"rollup -c ./rollup.config.js","compile":"npm-run-all -p compile:es2015 compile:es5 compile:cjs compile:types","compile:es2015":"tsc -p ./tsconfig.es2015.json","compile:es5":"tsc -p ./tsconfig.es5.json","compile:cjs":"tsc -p ./tsconfig.cjs.json","compile:types":"tsc -p ./tsconfig.types.json","clean":"rm -rf dist/*","lint":"tslint -c tslint.json -p ./tsconfig.spec.json -t stylish","lint:fix":"yarn run lint -- --fix","pretest:cov":"yarn run lint","test:cov":"jest --coverage","test":"jest --watch"},"dependencies":{"tslib":"^2.0.1"},"devDependencies":{"@babel/core":"^7.11.6","@rollup/plugin-commonjs":"^15.0.0","@rollup/plugin-node-resolve":"^9.0.0","@types/jest":"^26.0.13","@types/node":"^14.6.4","babel-jest":"^26.3.0","camelcase":"^6.0.0","jest":"^26.4.2","jest-environment-jsdom":"^26.3.0","npm-run-all":"^4.1.5","rollup":"^2.26.10","rollup-plugin-sourcemaps":"^0.6.2","rollup-plugin-terser":"^7.0.2","ts-jest":"^26.3.0","tslint":"^6.1.3","typescript":"^4.0.2"},"engines":{"node":">= 10"},"readme":"# File Selector\n\n> A small package for converting a [DragEvent](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent) or [file input](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file) to a list of File objects.\n\n[![npm](https://img.shields.io/npm/v/file-selector.svg?style=flat-square)](https://www.npmjs.com/package/file-selector)\n[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/react-dropzone/file-selector/Test?label=tests&style=flat-square)](https://github.com/react-dropzone/file-selector/actions?query=workflow%3ATest)\n[![Coveralls github branch](https://img.shields.io/coveralls/github/react-dropzone/file-selector/master?style=flat-square)](https://coveralls.io/github/react-dropzone/file-selector?branch=master)\n\n# Table of Contents\n\n* [Installation](#installation)\n* [Usage](#usage)\n* [Browser Support](#browser-support)\n* [Contribute](#contribute)\n* [Credits](#credits)\n\n\n### Installation\n----------------\nYou can install this package from [NPM](https://www.npmjs.com):\n```bash\nnpm add file-selector\n```\n\nOr with [Yarn](https://yarnpkg.com/en):\n```bash\nyarn add file-selector\n```\n\n#### CDN\nFor CDN, you can use [unpkg](https://unpkg.com):\n\n[https://unpkg.com/file-selector/dist/bundles/file-selector.umd.min.js](https://unpkg.com/file-selector/dist/bundles/file-selector.umd.min.js)\n\nThe global namespace for file-selector is `fileSelector`:\n```js\nconst {fromEvent} = fileSelector;\ndocument.addEventListener('drop', async evt => {\n    const files = await fromEvent(evt);\n    console.log(files);\n});\n```\n\n\n### Usage\n---------\n\n#### ES6\nConvert a `DragEvent` to File objects:\n```ts\nimport {fromEvent} from 'file-selector';\ndocument.addEventListener('drop', async evt => {\n    const files = await fromEvent(evt);\n    console.log(files);\n});\n```\n\nConvert a file input to File objects:\n```ts\nimport {fromEvent} from 'file-selector';\nconst input = document.getElementById('myInput');\ninput.addEventListener('change', async evt => {\n    const files = await fromEvent(evt);\n    console.log(files);\n});\n```\n\n#### CommonJS\nConvert a `DragEvent` to File objects:\n```ts\nconst {fromEvent} = require('file-selector');\ndocument.addEventListener('drop', async evt => {\n    const files = await fromEvent(evt);\n    console.log(files);\n});\n```\n\n\n### Browser Support\n-------------------\nMost browser support basic File selection with drag 'n' drop or file input:\n* [File API](https://developer.mozilla.org/en-US/docs/Web/API/File#Browser_compatibility)\n* [Drag Event](https://developer.mozilla.org/en-US/docs/Web/API/DragEvent#Browser_compatibility)\n* [DataTransfer](https://developer.mozilla.org/en-US/docs/Web/API/DataTransfer#Browser_compatibility)\n* [`<input type=\"file\">`](https://developer.mozilla.org/en-US/docs/Web/HTML/Element/input/file#Browser_compatibility)\n\nFor folder drop we use the [FileSystem API](https://developer.mozilla.org/en-US/docs/Web/API/FileSystem) which has very limited support:\n* [DataTransferItem.getAsFile()](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/getAsFile#Browser_compatibility)\n* [DataTransferItem.webkitGetAsEntry()](https://developer.mozilla.org/en-US/docs/Web/API/DataTransferItem/webkitGetAsEntry#Browser_compatibility)\n* [FileSystemEntry](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemEntry#Browser_compatibility)\n* [FileSystemFileEntry.file()](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemFileEntry/file#Browser_compatibility)\n* [FileSystemDirectoryEntry.createReader()](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryEntry/createReader#Browser_compatibility)\n* [FileSystemDirectoryReader.readEntries()](https://developer.mozilla.org/en-US/docs/Web/API/FileSystemDirectoryReader/readEntries#Browser_compatibility)\n\n\n### Contribute\n--------------\nIf you wish to contribute, please use the following guidelines:\n* Use [Conventional Commits](https://conventionalcommits.org)\n* Use `[ci skip]` in commit messages to skip a build\n\n\n### Credits\n-----------\n* [html5-file-selector](https://github.com/quarklemotion/html5-file-selector)\n","readmeFilename":"README.md","gitHead":"0e26d3557a1426c98e06f98de328754c8aa1ae37","bugs":{"url":"https://github.com/react-dropzone/file-selector/issues"},"_id":"file-selector@0.1.19","_nodeVersion":"12.19.0","_npmVersion":"6.14.8","dist":{"integrity":"sha512-kCWw3+Aai8Uox+5tHCNgMFaUdgidxvMnLWO6fM5sZ0hA2wlHP5/DHGF0ECe84BiB95qdJbKNEJhWKVDvMN+JDQ==","shasum":"8ecc9d069a6f544f2e4a096b64a8052e70ec8abf","tarball":"http://registry-npm.ywwl.com/file-selector/download/file-selector-0.1.19.tgz","fileCount":31,"unpackedSize":137613,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJfuiPuCRA9TVsSAnZWagAA3PUP/11/U1k1TOS2wUfyUusT\njYb3Ljxxt0fx3hecmY3SXchqkPaWR0YnSgJv4NAaEZXDPvajDr9rKPtIGGMk\nR4cOBKuvBv5Wh+yo3wG5nFs+LQSeIiqhj37rRsb4lFPtj57xmTxYU2NDG672\npQp4Npktc6wHpGwJjwYHc/93PjPb8P1T+l+kjZD7xrfsaRJ0huhXKSN1k3F1\nCPph+tmJ721y4ijydnyEMI/t4MyF/CHl1idQOQgolNeUyQA8KDA99dOoVPwt\n/Aen57ztTRzH5HGx1QvDqAKJLbHIqFNBHq4GYXtQRwVEtpCJw7xnHJbD6S11\nLmf0LZbzgOu0piAmCY7POsFlYjZ+oxHM0+saVl9blomqVumqYPYCZBrh/Asa\nLnWzAelCqsQVU4ZWsB5Q3ftgaKKfbOThNgsPIYPcIht5fkAgwZ1pk5W+MmL3\noocAgAj0Fy6tYQ6XCRwn4SQl+qR2AadJjoKmzhvfBk122DLX/k4SPrYi1i0C\n0y5irhgc8HtT4XjMsFFh35vMSsl/xWwRtSNSntETKfd5Prb8B0onvtBxqh/w\nvWI42NXWaxBJS2pkMEW0XMdyA1apBqQKP4f2h2J7/oD3veDeIh+amVK0oCai\nfQuj+02KGWjQg9ng502tsOSl9CEbJw2qQH7ePFs50V6x2cEYZKG06kAxgGVK\nhpBQ\r\n=3RWd\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEYWPSvWhMdHKCaR8re/LZEXLMiQo5CJ/vIVcGdYTB1/AiAsTukXuEzx4zyJt0aCTJtBOAc9PfB9hsMAaxzlAwXBtA=="}],"size":24872,"noattachment":false,"key":"/file-selector/-/file-selector-0.1.19.tgz"},"_npmUser":{"name":"rolandjitsu","email":"rolandjitsu@gmail.com"},"directories":{},"maintainers":[{"name":"okonet","email":"andrey@okonet.ru"},{"name":"rxmarbles","email":"rmarkins@gmail.com"},{"name":"rolandjitsu","email":"rolandjitsu@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/file-selector_0.1.19_1606034413447_0.09213718063896348"},"_hasShrinkwrap":false,"publish_time":1606034413769,"_cnpm_publish_time":1606034413769,"dist-tags":{"beta":"3.0.0-beta.6","latest":"5.0.3","release-0.1.x":"0.1.19","release-1.2.x":"1.2.0","release-2.1.x":"2.1.2"}}