@davetheitguy/filedrag
TypeScript icon, indicating that this package has built-in type declarations

1.0.8 • Public • Published

File Drag Module

JS Tests

This module allows for simple drag and drop functionality for files. It is a simple module that allows for the user to drag and drop files into a designated area. This module is useful for any application that requires the user to upload files.

This is a jquery plugin. The definition of the options are as follows

interface FileDragOptions {
    debug?: boolean; // If true, will log debug information to the console - default is false
    allowMultiple?: boolean; // If true, will allow multiple files to be uploaded - default is true
}

The module can be used as follows:

$('#file-drag').fileDrag({
    debug: true,
    allowMultiple: false
});

$('#file-drag').on('onFileDrop', function(files) {
    console.log(files);
});

Testing

Currently, due to Jest not working correctly with ESM, this has been removed, although unit tests do exist.

Dependencies (2)

Dev Dependencies (11)

Package Sidebar

Install

npm i @davetheitguy/filedrag

Weekly Downloads

1

Version

1.0.8

License

MIT

Unpacked Size

9.75 kB

Total Files

15

Last publish

Collaborators

  • davetheitguy