dubdrop

0.0.3 • Public • Published

dubdrop

Simple drag and drop file handler.

Progressively enhances file inputs to allow for dragging and dropping of files and running each file through async tasks.

Usage

var dubdrop = require('dubdrop');
 
var $input = dubdrop('#file-input', {
    'tasks': [
        function readFile (file, callback) {
            var reader = new FileReader();
 
            reader.onload = function (e) {
                console.log(file.name, ' loaded');
                console.log(e.target.result);
 
                callback(null, file);
            };
 
            reader.readAsText(file);
        },
 
        function trasnloadThis (file, callback) {
            // handle transloadit
        }
    ]
});

Contributing

Running example:

npm start

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    3
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    3
  • 0.0.2
    2
  • 0.0.1
    1

Package Sidebar

Install

npm i dubdrop

Weekly Downloads

6

Version

0.0.3

License

none

Last publish

Collaborators

  • drk