# on-window-size

> Listen to the window size

Latest version **1.0.2** (published 2016-03-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install on-window-size
pnpm add on-window-size
yarn add on-window-size
bun add on-window-size
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2016-03-18 |
| First published | 2016-03-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Andrew Joslin |
| Maintainers | andytjoslin |
| Keywords | window, resize, event, listen, unlisten |

## Links

- npm: https://www.npmjs.com/package/on-window-size
- Repository: https://github.com/ajoslin/on-window-size
- Homepage: https://github.com/ajoslin/on-window-size#readme
- Issues: https://github.com/ajoslin/on-window-size/issues
- npm.io page: https://npm.io/package/on-window-size

## Dependencies (3)

- [geval](https://npm.io/package/geval.md) ^2.1.1
- [global](https://npm.io/package/global.md) ^4.3.0
- [screen-size](https://npm.io/package/screen-size.md) ^1.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.2 (latest) — 2016-03-18
- 1.0.1 — 2016-03-18
- 1.0.0 — 2016-03-18

## README

# on-window-size [![Build Status](https://travis-ci.org/ajoslin/on-window-size.svg?branch=master)](https://travis-ci.org/ajoslin/on-window-size)

> Listen to the window size

## Install

```
$ npm install --save on-window-size
```

## Usage

```js
var onWindowSize = require('on-window-size')

onWindowSize(function (size) {
  console.log(size) // => {x: Number, y: Number}
})
```

## API

#### `var unlisten = onWindowSize(listener)`

Calls `listener` with the result of [screen-size](https://github.com/bendrucker/screen-size) when the window size changes.

Call the returned `unlisten` function to stop listening.

## License

MIT © [Andrew Joslin](http://ajoslin.com)

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