# @karibash/pixel-units

> Type-safe and mutually convertible pixel units.

Latest version **2.3.0** (published 2021-09-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @karibash/pixel-units
pnpm add @karibash/pixel-units
yarn add @karibash/pixel-units
bun add @karibash/pixel-units
```

## Health

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

Positive: has types; esm support; no vulnerabilities.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2021-09-20 |
| First published | 2020-11-28 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 400.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 9 |
| Author | Karibash |
| Maintainers | karibash |
| Keywords | typescript, pixel, units |

## Links

- npm: https://www.npmjs.com/package/@karibash/pixel-units
- Repository: https://github.com/Karibash/pixel-units
- Issues: https://github.com/Karibash/pixel-units/issues
- npm.io page: https://npm.io/package/@karibash/pixel-units

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.1

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 2.3.0 (latest) — 2021-09-20
- 2.2.0 — 2021-09-04
- 2.1.2 — 2021-08-31
- 2.1.1 — 2021-08-09
- 2.1.0 — 2021-08-09
- 2.0.2 — 2021-07-22
- 2.0.1 — 2021-07-22
- 2.0.0 — 2021-07-22
- 1.2.1 — 2021-01-17
- 1.2.0 — 2021-01-17
- 1.1.1 — 2020-12-18
- 1.1.0 — 2020-11-29
- 1.0.0 — 2020-11-28

## README

# pixel-units

[![Github](https://img.shields.io/github/followers/Karibash?label=Follow&logo=github&style=social)](https://github.com/Karibash?tab=followers)
[![Twitter](https://img.shields.io/twitter/follow/Karibash?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=Karibash)

## 🔧 Features

### Absolute length units

- [x] px
- [x] cm
- [x] mm
- [x] Q
- [x] in
- [x] pc
- [x] pt

### Relative length units

- [x] rem
- [x] em
- [x] vw
- [x] vh
- [x] vmin
- [x] vmax

### Multiplication units

- [x] percent
- [x] magnification

## 👏 Getting Started

The basic usage is as follows:

```typescript
import { Unit, convertUnits } from '@karibash/pixel-units';

const pixel: Unit<'px'> = '32px';
const rem = convertUnits(pixel, 'rem');

console.log(rem);
// -> 2rem
```

## 🚀 Installation

```
$ npm install @karibash/pixel-units
```

## 🤝 Contributing

Contributions, issues and feature requests are welcome.

Feel free to check [issues page](https://github.com/Karibash/pixel-units/issues) if you want to contribute.

## 📝 License

Copyright © 2020 [@Karibash](https://twitter.com/karibash).

This project is [```MIT```](https://github.com/Karibash/pixel-units/blob/master/LICENSE) licensed.

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