# the-unit

> Parses a number and unit string, and returns the unit used

Latest version **1.0.1** (published 2018-06-04) · MIT license · 0 weekly downloads

## Install

```sh
npm install the-unit
pnpm add the-unit
yarn add the-unit
bun add the-unit
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2018-06-04 |
| First published | 2018-06-04 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 2.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Zander Martineau |
| Maintainers | mrmartineau |
| Keywords | unit, parse unit, unit parse, get unit |

## Links

- npm: https://www.npmjs.com/package/the-unit
- Repository: https://github.com/mrmartineau/the-unit
- npm.io page: https://npm.io/package/the-unit

## Recent versions

- 1.0.1 (latest) — 2018-06-04
- 1.0.0 — 2018-06-04

## README

<h1 align="center">
  the-unit

[![npm](https://img.shields.io/npm/v/the-unit.svg?style=flat-square)](https://www.npmjs.com/package/the-unit)
![](https://img.shields.io/badge/licence-MIT-blue.svg?style=flat-square)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com)

</h1>

> Parses a number and unit string, and returns the unit used

Unlike some similar packages (see below), this package only returns the unit for a particular string; it is intentionally simple.

## Install

```sh
$ yarn add the-unit
$ npm install --save-dev the-unit
```

## Import

```js
import unit from "the-unit";
```

## Use

```js
unit("16px"); // 'px'
```

## Size

[98 Bytes](https://bundlephobia.com/result?p=the-unit)

## Similar packages

- [parse-unit](https://github.com/mattdesl/parse-unit)
- [unit-parse](https://github.com/centagon/unit-parse)
- [parseunit](https://github.com/ThomWright/parseunit)
- [get-unit](https://github.com/arthurvr/get-unit)

## Licence

MIT &copy; [Zander Martineau](https://zander.wtf)

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