# drag-stream

> streamable mouse drag data

Latest version **0.0.3** (published 2013-03-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install drag-stream
pnpm add drag-stream
yarn add drag-stream
bun add drag-stream
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.3 |
| Published | 2013-03-05 |
| First published | 2012-11-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 16 |
| Author | Chris Dickinson |
| Maintainers | chrisdickinson |
| Keywords | readable, stream, browserify, drag |

## Links

- npm: https://www.npmjs.com/package/drag-stream
- Repository: https://github.com/chrisdickinson/drag-stream
- npm.io page: https://npm.io/package/drag-stream

## Dependencies (2)

- [through](https://npm.io/package/through.md) ~2.2.1
- [domnode-dom](https://npm.io/package/domnode-dom.md) ~0.0.X

## Alternatives

- [byte-size](https://npm.io/package/byte-size.md) — 2.1M weekly downloads
- [speed-limiter](https://npm.io/package/speed-limiter.md) — 16.0K weekly downloads
- [@powersync/node](https://npm.io/package/@powersync/node.md) — 10.9K weekly downloads
- [@ledgerhq/coin-cardano](https://npm.io/package/@ledgerhq/coin-cardano.md) — 1.0K weekly downloads
- [@jayesol/jayeson.lib.streamfinder](https://npm.io/package/@jayesol/jayeson.lib.streamfinder.md) — 1.0K weekly downloads

## Recent versions

- 0.0.3 (latest) — 2013-03-05
- 0.0.2 — 2012-11-15
- 0.0.1 — 2012-11-12

## README

# drag-stream

A readable stream of drag data for an element.

```javascript

var drag = require('../index')
  , el = document.getElementById('content')

drag(el)
  .on('data', function(data) {
    // data == {dx:int, dy:int, dt:int}
  })
  .pipe(
    through(function(data) {
      this.emit('data', [data.dx, data.dy, data.dt].join(', ')) 
    })
  )

```

## API

### require('drag-stream') -> drag(el)

### drag(el) -> readable stream

The stream will emit data events between a mousedown on the target `el`
and mouseup anywhere else on the page.

The data events take the form of an x-delta, y-delta, and time-delta.

When a drag is started, its time-delta will be `0` and its x and y deltas
will be the screen offset of the initial mousedown event.

---
_Source: https://npm.io/package/drag-stream · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
