# detect-resize

> Detect element resize in universal applications.

Latest version **0.1.5** (published 2016-06-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install detect-resize
pnpm add detect-resize
yarn add detect-resize
bun add detect-resize
```

## 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.1.5 |
| Published | 2016-06-08 |
| First published | 2016-06-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Cole Chamberlain |
| Maintainers | cchamberlain |
| Keywords | sync, local, storage, cookies, stream, ie, fallback |

## Links

- npm: https://www.npmjs.com/package/detect-resize
- Repository: https://github.com/noderaider/detect-resize
- Homepage: http://detect-resize.js.org
- Issues: https://github.com/noderaider/detect-resize/issues
- npm.io page: https://npm.io/package/detect-resize

## Dependencies (1)

- [chai](https://npm.io/package/chai.md) ^3.0.0

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 0.1.5 (latest) — 2016-06-08
- 0.1.4 — 2016-06-07
- 0.1.3 — 2016-06-07
- 0.1.2 — 2016-06-07
- 0.1.1 — 2016-06-07

## README

## detect-resize

**Slightly refactored version of https://github.com/sdecima/javascript-detect-element-resize targeting universal React applications. Will not throw if imported (ES6) on the server.**

[![Build Status](https://travis-ci.org/noderaider/detect-resize.svg?branch=master)](https://travis-ci.org/noderaider/detect-resize)

[![NPM](https://nodei.co/npm/detect-resize.png?stars=true&downloads=true)](https://nodei.co/npm/detect-resize/)


## Install

`npm i -S detect-resize`


## How to use

Should work the same as [javascript-detect-element-resize](https://github.com/sdecima/javascript-detect-element-resize) without throwing errors if used in a server environment.

```js
import { addResizeListener, removeResizeListener } from 'detect-resize'

const resizeElement = document.getElementById('resizeElement'),
const handleResize = () => { console.info('resized') }

addResizeListener(resizeElement, handleResize)
removeResizeListener(resizeElement, handleResize)
```

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