has-directory-upload

1.0.0 • Public • Published

has-directory-upload

Detect if either either Web Incubator Community Group or Chrome 11-style directory uploads are supported in your current environment

Example implementation

import HDU from 'has-directory-upload'

let uploadStrategy = null
if (HDU.WICGSupport)
  uploadStrategy = someWICGStrategy(HDU.WICGSupport.live)
else if (HDU.Chrome11Support)
  uploadStrategy = someChrome11Strategy(HDU.Chrome11Support.live)
else
  uploadStrategy = someNonDirectoryAlternativeStrategy(e => !!e.files)

has-directory-upload provides both up-front feature detection and off the cuff checking of Event instances. In the above example implementation the Event instance checkers are being passed to the imagined Strategy functions

/has-directory-upload/

    Package Sidebar

    Install

    npm i has-directory-upload

    Weekly Downloads

    1

    Version

    1.0.0

    License

    MIT

    Last publish

    Collaborators

    • jameswomack