Socket
Socket
Sign inDemoInstall

flat-files

Package Overview
Dependencies
0
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    flat-files

Get a flatten array of dropped files using FileSystem api


Version published
Weekly downloads
4.3K
increased by12.86%
Maintainers
1
Install size
33.8 kB
Created
Weekly downloads
 

Readme

Source

flat-files Build Status https://zzarcon.github.io/flat-files

Get a flatten array of dropped files using FileSystem api

Demo

https://zzarcon.github.io/flat-files

Usage

import flatFiles from 'flat-files';

flatFiles(document.querySelector('#dropzone'), (files: FileSystemEntry[]) => {
  files.forEach(file => {
    console.log(
      file.name,
      file.fullPath,
      file.getMetadata()
    );
  })
});

Use case

Imagine you have drag & drop support in your app, thats great. Now imagine the use drops a folder containing a folder containing a folder, containing a folder... you get the idea.

All that I want is to have a nice way to get all those files and do something with them (upload them, show a preview, etc). Thats what flat-files gives to you, it deals with the FileSystem and gives a flatten array of FileSystemEntry

TODO

  • Release script
  • Browser support
  • Error callback

FAQs

Last updated on 30 Jul 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