# unitr

> ## What

Latest version **1.1.1** (published 2015-07-16) · ISC license · 0 weekly downloads

## Install

```sh
npm install unitr
pnpm add unitr
yarn add unitr
bun add unitr
```

## 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.1.1 |
| Published | 2015-07-16 |
| First published | 2014-04-15 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Kory Nunn |
| Maintainers | korynunn |

## Links

- npm: https://www.npmjs.com/package/unitr
- Repository: https://github.com/KoryNunn/unitr
- Homepage: https://github.com/KoryNunn/unitr#readme
- Issues: https://github.com/KoryNunn/unitr/issues
- npm.io page: https://npm.io/package/unitr

## Recent versions

- 1.1.1 (latest) — 2015-07-16
- 1.1.0 — 2014-04-16
- 1.0.2 — 2014-04-15
- 1.0.1 — 2014-04-15
- 1.0.0 — 2014-04-15

## README

# Unit

## What

Adds units to numbers or parses them from united strings.

## Usage

Require:

    var unitr = require('unitr');

Signaute:

    unitr(value [, unit]) -> String

If no unit is passed, it will add 'px'

If the value already has a unit, the unit will not be changed.

## Example

Add 'px' to a number:

    unitr(10); // -> "10px"

Add '%' to a number:

    unitr(10, '%'); // -> "10%"

Attempt Add '%' to a value that is in px:

    unitr('10px', '%'); // -> "10px"

Parse a value:

    unitr.parse('10px'); // -> {value: 10, unit: 'px'}

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