# get-size

> measures element size

Latest version **3.0.0** (published 2021-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install get-size
pnpm add get-size
yarn add get-size
bun add get-size
```

## Health

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

Positive: has types package; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2021-12-20 |
| First published | 2014-10-17 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | separate (@types/get-size) |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 16.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 175 |
| Author | David DeSandro |
| Maintainers | desandro |
| Keywords | size, DOM |

## Links

- npm: https://www.npmjs.com/package/get-size
- Repository: https://github.com/desandro/get-size
- Issues: https://github.com/desandro/get-size/issues
- npm.io page: https://npm.io/package/get-size

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2021-12-20
- 2.0.3 — 2018-04-06
- 2.0.2 — 2016-01-04
- 2.0.1 — 2016-01-03
- 2.0.0 — 2015-12-21
- 1.2.2 — 2014-11-26
- 1.2.1 — 2014-11-24
- 1.2.0 — 2014-11-18
- 1.1.8 — 2014-10-20
- 1.1.7 — 2014-10-17

## README

# getSize

Get the size of elements. Used in [Masonry](https://masonry.desandro.com), [Isotope](https://isotope.metafizzy.co), &  [Flickity](https://flickity.metafizzy.co). 

``` js
var size = getSize( elem );
// elem can be an element
var size = getSize( document.querySelector('.selector') )
// elem can be a selector string
var size = getSize('.selector')
```

Returns an object with: 

+ width, height
+ innerWidth, innerHeight
+ outerWidth, outerHeight
+ paddingLeft, paddingTop, paddingRight, paddingBottom
+ marginLeft, marginTop, marginRight, marginBottom
+ borderLeftWidth, borderTopWidth, borderRightWidth, borderBottomWidth
+ isBorderBox

Browser support: Chrome 51+, Firefox 50+, Edge 12+, Safari 10+,

## Install

npm: `npm install get-size`

Yarn: `yarn add get-size`

## MIT License

getSize is released under the MIT License. Have at it.

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