# parse-rect

> Parse any input rectangle format

Latest version **1.2.0** (published 2018-03-19) · MIT license · 0 weekly downloads

## Install

```sh
npm install parse-rect
pnpm add parse-rect
yarn add parse-rect
bun add parse-rect
```

## 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.2.0 |
| Published | 2018-03-19 |
| First published | 2018-02-12 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 6.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Dmitry Yv |
| Maintainers | dfcreative |
| Keywords | rect, rectangle, parse |

## Links

- npm: https://www.npmjs.com/package/parse-rect
- Repository: https://github.com/dfcreative/parse-rect
- Homepage: https://github.com/dfcreative/parse-rect#readme
- Issues: https://github.com/dfcreative/parse-rect/issues
- npm.io page: https://npm.io/package/parse-rect

## Dependencies (1)

- [pick-by-alias](https://npm.io/package/pick-by-alias.md) ^1.2.0

## 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

- 1.2.0 (latest) — 2018-03-19
- 1.1.1 — 2018-02-12
- 1.1.0 — 2018-02-12
- 1.0.1 — 2018-02-12
- 1.0.0 — 2018-02-12

## README

# parse-rect [![experimental](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges) [![Build Status](https://travis-ci.org/dfcreative/parse-rect.png)](https://travis-ci.org/dfcreative/parse-rect)

Take any rectangle-like argument and return rectangle values.

[![npm install parse-rect](https://nodei.co/npm/parse-rect.png?mini=true)](https://npmjs.org/package/parse-rect/)

```js
const parseRect = require('parse-rect')

// {x: 10, y: 20, width: 90, height: 80}
parseRect('10 20 100 100')
parseRect(10, 20, 100, 100)
parseRect([10, 20, 100, 100])
parseRect({ x: 10, y: 20, width: 90, height: 80 })
parseRect({ x: 10, y: 20, w: 90, h: 80 })
parseRect({ l: 10, t: 20, r: 100, b: 100 })
parseRect({ left: 10, top: 20, right: 100, bottom: 100 })

// {x: 0, y: 0, width: 90, height: 80}
parseRect({ width: 90, height: 80 })
parseRect([ 90, 80 ])

// {x: 0, y: 0, width: 90, height: 90}
parseRect(90)
parseRect([90])
```

## License

(c) 2018 Dmitry Yv. MIT License

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