# numconv

> Utility to convert integers between bases

Latest version **1.0.2** (published 2019-01-13) · ISC license · 0 weekly downloads

## Install

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

Provides the command `numconv`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.2 |
| Published | 2019-01-13 |
| First published | 2019-01-06 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | alxtford |
| Maintainers | alxtford |
| Keywords | hex, dec, binary, util, cli, math |

## Links

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

## Dependencies (3)

- [sywac](https://npm.io/package/sywac.md) ^1.2.1
- [figlet](https://npm.io/package/figlet.md) ^1.2.1
- [sywac-style-basic](https://npm.io/package/sywac-style-basic.md) ^1.0.1

## Alternatives

- [random-seedable](https://npm.io/package/random-seedable.md) — 27.9K weekly downloads
- [n2words](https://npm.io/package/n2words.md) — 22.2K weekly downloads
- [@stdlib/math-base-special-factorialln](https://npm.io/package/@stdlib/math-base-special-factorialln.md) — 5.7K weekly downloads
- [@stdlib/math-base-special-abs2](https://npm.io/package/@stdlib/math-base-special-abs2.md) — 1.7K weekly downloads
- [commons-math-interpolation](https://npm.io/package/commons-math-interpolation.md) — 1.4K weekly downloads

## Recent versions

- 1.0.2 (latest) — 2019-01-13
- 1.0.1 — 2019-01-13
- 1.0.0 — 2019-01-13
- 0.7.6 — 2019-01-13
- 0.7.4 — 2019-01-13
- 0.7.3 — 2019-01-13
- 0.7.2 — 2019-01-13
- 0.7.0 — 2019-01-13
- 0.2.0 — 2019-01-06
- 0.1.0 — 2019-01-06

## README

# numconv

> Utility to convert integers between bases

[![Build Status](https://travis-ci.com/alxtford/numconv.svg?branch=master)](https://travis-ci.com/alxtford/numconv)
[![JavaScript Style Guide](https://img.shields.io/badge/code_style-standard-brightgreen.svg)](https://standardjs.com)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/ade8499d0f2f47e3a7f9c7e57c2e8010)](https://www.codacy.com/app/alxtford/numconv?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=alxtford/numconv&amp;utm_campaign=Badge_Grade)
[![install size](https://packagephobia.now.sh/badge?p=numconv)](https://packagephobia.now.sh/result?p=numconv)

## Install

```console
$ npm i -g numconv
```
### or

```console
$ npm i numconv --save
```

## Usage

```console
$ numconv --help
```
### or

```console
var numConv = require('numConv')

// numConv(inputVar, inputBase, outputBase)
var obj = numConv('0xFF', 16, 10)

/* obj = {
 *  var: 255,
 *  err_code: 1,
 *  log: ''
 * } */

```

### NOTE:
* `inputVar` must be a string if it contains any characters. Can be an integer if only values 0-9 are used
* `inputBase` and `outputBase` must be bases 2-32

## Output
Format of the return output is as follows:

`var: ` Is the converted value. Will be === `0` if an error is encountered.

`err_code: ` Can be used for validity checking. Will return 1 on success.

`log: ` Will be `''` by default, or on success. A string describing the error will be returned if `err_code` === 0 (error)

## License

ISC © Contributors

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