Latest Threat ResearchGlassWorm Loader Hits Open VSX via Developer Account Compromise.Details
Socket
Book a DemoInstallSign in
Socket

drag-and-drop-files

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

drag-and-drop-files

Handle file drag and drop events without all the Yak shaving

latest
Source
npmnpm
Version
0.0.1
Version published
Maintainers
1
Created
Source

drag-and-drop-files

Handle file drag and drop events in an HTML5 capable browser with less Yak shaving.

Example

var dropTarget = document.querySelector("#dropTarget")

require("drag-and-drop-files")(dropTarget, function(files) {
  console.log("Got some files:", files)
})

Install

npm install drag-and-drop-files

require("drag-and-drop-files")(element, callback(files) )

Hooks a listener for a file data transfer event.

  • element is the DOM element to listen for file events on
  • callback(files) is a callback that gets fired when the files are dropped on to it. The argument files is an array of all the file objects that were dragged onto the element.

Credits

(c) 2013 Mikola Lysenko. MIT License

Keywords

file

FAQs

Package last updated on 20 Jul 2013

Did you know?

Socket

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