# binarystrings

> Convert Strings to ArrayBuffers and back

Latest version **1.0.1** (published 2018-01-21) · ISC license · 0 weekly downloads

## Install

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

## 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.0.1 |
| Published | 2018-01-21 |
| First published | 2018-01-20 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chewy! |
| Maintainers | chewythepig |
| Keywords | binary, arraybuffer, string |

## Links

- npm: https://www.npmjs.com/package/binarystrings
- npm.io page: https://npm.io/package/binarystrings

## 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

- 1.0.1 (latest) — 2018-01-21
- 1.0.0 — 2018-01-20

## README

# BinaryString
Translate ArrayBuffers to strings and vice versa in JavaScript.
This library is mainly useful for sending WebSocket messages as Binary packets without having a intermediate knowledge of how binary works.
It is also compatible with environments that do not support ES6+.

## Browser
Insert the script tag into your markup:
```HTML
<script src="https://cdn.jsdelivr.net/npm/binarystring@1.0.1/binarystring.min.js"></script>
```
Usage in the browser:
```JavaScript
const BinaryString = window.BinaryString;

const buffer = BinaryString.Write('test');
const string = BinaryString.Read(buffer); 

console.log(string, ' <--> ', buffer);
console.log('BinaryString works!');
```

## Node.JS
Install with the command:
```BASH
npm i binarystrings
```
Usage in Node.js:
```JavaScript
const BinaryString = require('binarystring');

const buffer = BinaryString.Write('test');
const string = BinaryString.Read(buffer); 

console.log(string, ' <--> ', buffer);
console.log('BinaryString works!');
```

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