# decode-encode-binary

> A Module/CLI to encode & decode binary numbers

Latest version **3.0.0** (published 2023-12-14) · MIT license · 0 weekly downloads

## Install

```sh
npm install decode-encode-binary
pnpm add decode-encode-binary
yarn add decode-encode-binary
bun add decode-encode-binary
```

Provides the commands `decenc`, `encdec`.

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.0 |
| Published | 2023-12-14 |
| First published | 2019-09-05 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 7.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 6 |
| Author | thechickienagget |
| Maintainers | thechickienagget |
| Keywords | decode, encode, binary to text, text to binary, cli |

## Links

- npm: https://www.npmjs.com/package/decode-encode-binary
- Repository: https://github.com/thechickennagget/decode-encode-binary
- Homepage: https://github.com/thechickennagget/decode-encode-binary/blob/master/README.md
- Issues: https://github.com/thechickennagget/decode-encode-binary/issues
- npm.io page: https://npm.io/package/decode-encode-binary

## Dependencies (1)

- [inquirer](https://npm.io/package/inquirer.md) latest

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2023-12-14
- 2.0.6 — 2022-10-15
- 2.0.5 — 2021-04-27
- 2.0.4 — 2021-02-26
- 1.0.3 — 2021-01-29
- 2.0.3 — 2020-12-30
- 2.0.2 — 2020-11-29
- 2.0.1 — 2020-11-29
- 2.0.0 — 2020-11-29
- 1.4.16 — 2020-11-18
- 1.4.14 — 2020-08-17
- 1.4.13 — 2020-06-27
- 1.4.12 — 2020-06-11
- 1.4.11 — 2020-05-30
- 1.4.10 — 2020-05-30
- … 26 more at https://npm.io/package/decode-encode-binary/versions

## README

# decode-encode-binary
### A Module/CLI to encode & decode binary numbers

![GitHub repo size](https://img.shields.io/github/repo-size/TheChickenNagget/decode-encode-binary?color=dgreen&label=Package%20Size&logo=github)
![Total Downloads](https://badgen.net/npm/dt/decode-encode-binary)
![Line](https://github.com/TheChickenNagget/assets/raw/master/images/line.png)

## Installation
##### Using [npm](https://www.npmjs.com/package/decode-encode-binary)
```shell
$ npm install decode-encode-binary
```

##### Using [Yarn](https://yarnpkg.com/en/package/decode-encode-binary)
```shell
$ yarn add decode-encode-binary
```
------

## Using in Terminal
- The Terminal command is `encdec` or `decenc` (both function the same)
- Using in Terminal requires to have package installed with the `--global` tag
```shell
$ encdec
$ > Enter your input (Binary/Text)
$ > Hi
$ 0100100001101001
```
```shell 
$ decenc
$ > Enter your input (Binary/Text)
$ > 0100100001101001
$ Hi
```
------

## Examples
#### An example of **decoding** text from binary numbers

```js
const test = require("decode-encode-binary");
test.decode("0100100001100101011011000110110001101111");

// output: "Hello"
```

#### An example of **encoding** text to binary numbers
```js
const test = require("decode-encode-binary");
test.encode("Hello");

// output: "0100100001100101011011000110110001101111"
```
- A binary letter padding can be used by setting boolean as the second parameter
```js
const test = require("decode-encode-binary");
test.encode("Hi", true);

// output: "01001000 01101001"
```

#### An example of using `determine`
```js
const test = require("decode-encode-binary");

test.determine("Hi");
// output: 0100100001101001

test.determine("0100100001101001");
// output: "Hi"
```

[![Try on Runkit](https://img.shields.io/badge/-Try%20on%20Runkit-red?style=for-the-badge)](https://npm.runkit.com/decode-encode-binary)
[![Star On GitHub](https://img.shields.io/badge/-Star%20on%20Github%20⭐-yellow?style=for-the-badge)](https://github.com/TheChickenNagget/decode-encode-binary/stargazers)
[![Fork On GitHub](https://img.shields.io/badge/-Fork%20on%20Github%20🔨-green?style=for-the-badge)](https://github.com/TheChickenNagget/decode-encode-binary/fork)
![Line](https://github.com/TheChickenNagget/assets/raw/master/images/line.png)

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