npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ds-dragdrop

v0.2.3

Published

Adds simulated drag / drop events to lists of items. Does not rely on the [drag and drop API](https://developer.mozilla.org/en-US/docs/Web/API/HTML_Drag_and_Drop_API) as it's not yet implemented across all desktop browsers or at all in mobile browsers.

Readme

DS-DragDrop

Adds simulated drag / drop events to lists of items. Does not rely on the drag and drop API as it's not yet implemented across all desktop browsers or at all in mobile browsers.

Usage:

new DragDrop(container <HTMLElement>, dropzone <HTMLElement>, options <Object>);

DS-DragDrop will assign special classes and listeners to all immediate children of itemContainer so that they can be dragged.

For custom thumbnails make sure each child of itemContainer has a data-thumb attribute, the value of each pointing to the thumbnail image you want to appear when dragging.

options.elector string: if null, drag and drop listeners will be applied to the entire child, if not null drag and drop listeners will be applied to the first matching element with this selector. default is null. Note that this is also the element that ds-drag-drop will look for the 'data-thumb' attribute.
options.centered boolean: true will center the thumbnail
options.preload boolean: if true, all thumbs will be centered on the cursor, if false, the cursor's initial offset on the item will be maintained.
options.scrollMargin number: if more than 0, this is the amount of pixels near the top and bottom edge that will force the page to scroll while dragging.
options.offset object: contains x and y pixel values for where to attach the data-thumb image if centered isn't desired.

Example:

import DragDrop from 'ds-dragdrop';

const itemContainer = document.querySelector('.items');
const dropZone = document.querySelector('.dropzone');

const dragdrop = new DragDrop(itemContainer, dropZone);

Demo:

A demo project is included in this repo, to view it, serve the root of this folder (example: serve) and then view it in the browser at http://localhost:5000/demo

Developing:

cd ~
git clone [email protected]:daveseidman/drag-drop.git
cd ~/drag-drop
npm install  // <- install dependencies for ds-dragdrop
npm link     // <- creates a global symlink pointing to this folder
npm watch    // <- as you edit src/index.js webpack will automatically recompile the /dist folder

in another project use the symlinked version of ds-drag-drop by running the following command inside the project folder (at the same level as package.json):

npm link ds-dragdrop

Now as you make changes to the module your project should always have the latest version. If your project automatically rebuilds whenever one of it's dependencies are updated it should automatically update inside your project as well.