0.0.6 • Published 7 years ago

ff-file-uploader v0.0.6

Weekly downloads
50
License
MIT
Repository
github
Last release
7 years ago

ff-file-uploader

Features:

  • whitelist file types
  • set a max file size
  • drag and drop
  • hides drag and drop UI on mobile
  • overrides default <input type='file'> styles
  • returns the following streams:

    • file$
    • error$ (based on whitelisted file types and max file size)
    • image$ (if file type is image)
    • text$ (if file type is text)

Demo: https://flimflamjs.github.io/ff-file-uploader/

Usage:

const uploader = require('ff-image-uploader')

const init = () => {
  let state = {}
  state.uploader = uploader.init({fileTypes: ['jpeg', 'png', 'plain'], maxKB: 2000})
  return state
}

const view = state =>
  h('div'
  , [
      uploader.view({
        noDrag: true // optional - hides drag and drop UI
      , dragContent: h('h3', 'Drag to upload a file...') // optional
      , clickContent: h('button', 'or browse...') // optional
      , state: state.uploader
      })
    ]  
  )
0.0.6

7 years ago

0.0.5

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago

0.0.1

7 years ago