# normalize-hex

> Normalize a hex string

Latest version **0.0.6** (published 2019-07-12) · MIT license · 0 weekly downloads

## Install

```sh
npm install normalize-hex
pnpm add normalize-hex
yarn add normalize-hex
bun add normalize-hex
```

## Health

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

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

Warnings: low downloads; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2019-07-12 |
| First published | 2019-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 5.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | Miguel Mota |
| Maintainers | miguelmota |
| Keywords | normalize, hex, string, prefix |

## Links

- npm: https://www.npmjs.com/package/normalize-hex
- Repository: https://github.com/miguelmota/normalize-hex
- Issues: https://github.com/miguelmota/normalize-hex/issues
- npm.io page: https://npm.io/package/normalize-hex

## Dependencies (1)

- [bn.js](https://npm.io/package/bn.js.md) ^4.11.8

## Alternatives

- [@mce/gif](https://npm.io/package/@mce/gif.md) — 2.6K weekly downloads
- [cleanse](https://npm.io/package/cleanse.md) — 173 weekly downloads
- [str](https://npm.io/package/str.md) — 127 weekly downloads
- [naming](https://npm.io/package/naming.md) — 95 weekly downloads
- [tap-telco-api](https://npm.io/package/tap-telco-api.md) — 19 weekly downloads

## Recent versions

- 0.0.6 (latest) — 2019-07-12
- 0.0.5 — 2019-06-27
- 0.0.4 — 2019-06-23
- 0.0.3 — 2019-06-23
- 0.0.2 — 2019-06-23
- 0.0.1 — 2019-06-23

## README

# normalize-hex

> Normalize a hex string

[![License](http://img.shields.io/badge/license-MIT-blue.svg)](https://raw.githubusercontent.com/miguelmota/normalize-hex/master/LICENSE)
[![NPM version](https://badge.fury.io/js/normalize-hex.svg)](http://badge.fury.io/js/normalize-hex)

## Install

```bash
npm install normalize-hex
```

## Getting started

```javascript
const normalizeHex = require('normalize-hex')

console.log(normalizeHex('abc')) // 'abc'
console.log(normalizeHex('abc', { evenLength: true })) // '0abc'
console.log(normalizeHex('abc', { addPrefix: true })) // '0xabc'
console.log(normalizeHex('abc', { evenLength: true, addPrefix: true })) // '0x0abc'
console.log(normalizeHex('0xabc')) // 'abc'
console.log(normalizeHex('')) // '0'
console.log(normalizeHex('', { evenLength: true, addPrefix: true })) // '0x00'
```

## Test

```bash
npm test
```

## License

[MIT](LICENSE)

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