# @laomao800/parse-size-with-unit

> A helper to parse 'size like' value into a valid size with unit.

Latest version **1.0.3** (published 2019-12-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install @laomao800/parse-size-with-unit
pnpm add @laomao800/parse-size-with-unit
yarn add @laomao800/parse-size-with-unit
bun add @laomao800/parse-size-with-unit
```

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.3 |
| Published | 2019-12-08 |
| First published | 2019-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | laomao800 |

## Links

- npm: https://www.npmjs.com/package/@laomao800/parse-size-with-unit
- Homepage: https://github.com/laomao800/parse-size-with-unit
- npm.io page: https://npm.io/package/@laomao800/parse-size-with-unit

## Recent versions

- 1.0.3 (latest) — 2019-12-08
- 1.0.0 — 2019-09-23

## README

# parse-size-with-unit

A helper to parse 'size like' value into a valid size with unit.

## Install

```bash
yarn add @laomao800/parse-size-with-unit

# or

npm install --save @laomao800/parse-size-with-unit
```

## Usage

```js
import parseSize from '@laomao800/parse-size-with-unit'

parseSize(50) // '50px'
parseSize('50') // '50px'
parseSize('50px') // '50px'
parseSize('50%') // '50%'
parseSize('50.5px') // '50.5px'
parseSize('50.5%') // '50.5%'
parseSize('a') // null

// Default unit. Supports all CSS valid unit.
parseSize(50, 'em') // '50em'
```

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