# srraf

> Better scroll and resize handling

Latest version **3.2.1** (published 2020-06-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install srraf
pnpm add srraf
yarn add srraf
bun add srraf
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.2.1 |
| Published | 2020-06-25 |
| First published | 2017-01-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 29 |
| Author | estrattonbailey |
| Maintainers | estrattonbailey |

## Links

- npm: https://www.npmjs.com/package/srraf
- Repository: https://github.com/estrattonbailey/srraf
- Homepage: https://github.com/estrattonbailey/srraf#readme
- Issues: https://github.com/estrattonbailey/srraf/issues
- npm.io page: https://npm.io/package/srraf

## Recent versions

- 3.2.1 (latest) — 2020-06-25
- 3.2.0 — 2019-05-28
- 3.1.4 — 2019-01-12
- 3.1.3 — 2019-01-10
- 3.1.2 — 2018-11-01
- 3.1.1 — 2018-10-29
- 3.1.0 — 2018-10-29
- 3.0.2 — 2018-09-22
- 3.0.1 — 2018-09-22
- 3.0.0 — 2018-09-20
- 2.0.1 — 2018-03-25
- 2.0.0 — 2018-03-21
- 1.0.1 — 2017-05-05
- 1.0.0 — 2017-05-05
- 0.1.0 — 2017-01-27
- … 3 more at https://npm.io/package/srraf/versions

## README

# srraf
Monitor scrolling and resizing without event listeners. **300 bytes gzipped.**

## Install 
```bash
npm i srraf --save
```

# Usage
```javascript
import srraf from 'srraf'

const scroller = srraf(({ x, px, y, py, vh, pvh, vw, pvw }, timestamp) => {
  // ...
})

scroller.update() // check position
scroller.destroy() // destroy listener
```

Note: values prefixed with `p` denote *previous* values.

## License
MIT License © [Eric Bailey](https://estrattonbailey.com)

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