Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

component-drop

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

component-drop

drag and drop file uploading with a single drop event

  • 0.1.7
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
2
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

Drop

Drag and drop upload component providing each drop as a single event for easy filtering and custom precedence.

Installation

$ component install component/drop

Features

  • normalizes all items and files into a single e.items array
  • auto-populates .string for string related items
  • walks directories (webkit only)

Example

The e.items array contains File objects for file uploads, and regular objects for string related drops.

var drop = require('drop')
var el = document.querySelector('#drop')

drop(el, function(e){
  var items = e.items
  items.forEach(function(item){
    console.log(item)
  })
})

File

Dropping files results in File objects with the following properties. When file(s) are uploaded via dropping a directory the .entry property is populated which allows you to reference item.entry.fullPath.

  • kind "file"
  • lastModifiedDate
  • name filename
  • size file size
  • type mime type
  • entry FileEntry object

Item

Dropping strings or urls results in objects with the following properties:

  • kind "string"
  • type mime type
  • string value

License

MIT

Keywords

FAQs

Package last updated on 11 Feb 2014

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc