# sc-codec-min-bin

> Minimal binary codec for SC based on MessagePack

Latest version **3.0.0** (published 2017-09-24) · MIT license · 0 weekly downloads

## Install

```sh
npm install sc-codec-min-bin
pnpm add sc-codec-min-bin
yarn add sc-codec-min-bin
bun add sc-codec-min-bin
```

## 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 | 3.0.0 |
| Published | 2017-09-24 |
| First published | 2016-11-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 24 |
| Author | Jonathan Gros-Dubois |
| Maintainers | topcloudsystems |
| Keywords | socketcluster, codec, messagepack, binary |

## Links

- npm: https://www.npmjs.com/package/sc-codec-min-bin
- Repository: https://github.com/SocketCluster/sc-codec-min-bin
- Issues: https://github.com/SocketCluster/sc-codec-min-bin/issues
- npm.io page: https://npm.io/package/sc-codec-min-bin

## Dependencies (1)

- [msgpack-lite](https://npm.io/package/msgpack-lite.md) 0.1.26

## Alternatives

- [@opentelemetry/exporter-zipkin](https://npm.io/package/@opentelemetry/exporter-zipkin.md) — 14.8M weekly downloads
- [pusher-js](https://npm.io/package/pusher-js.md) — 2.0M weekly downloads
- [browserify](https://npm.io/package/browserify.md) — 1.7M weekly downloads
- [sqs-consumer](https://npm.io/package/sqs-consumer.md) — 1.7M weekly downloads
- [@sanity/eventsource](https://npm.io/package/@sanity/eventsource.md) — 930.8K weekly downloads

## Recent versions

- 3.0.0 (latest) — 2017-09-24
- 2.0.0 — 2016-12-11
- 1.0.1 — 2016-11-25
- 1.0.0 — 2016-11-25

## README

# sc-codec-min-bin
Minimal binary codec for SC based on MessagePack.  
This codec helps reduce bandwidth usage and is ideal for games and other high-throughput applications.

This module is designed to be hooked up on both the client and server.

To install, use:

```bash
npm install sc-codec-min-bin
```

On the server, inside `worker.js`, you should use:

```js
var scCodecMinBin = require('sc-codec-min-bin');

// ...
// This needs to go inside the run function - Near the top.
worker.scServer.setCodecEngine(scCodecMinBin);
```

On the client-side, you can either include the `sc-codec-min-bin` module using
your favorite bundler such as Browserify or Webpack or you can include the `sc-codec-min-bin.js`
file using a script tag; this will expose the `scCodecMinBin` object globally.
To use it, you just need to add it on connect:

```js
var socket = socketCluster.connect({
  // ...
  codecEngine: scCodecMinBin
});
```

Note that the codec used on the client and on the server always need to match.

---

## Contributing

To build the global script for the browser:

```bash
browserify -s scCodecMinBin index.js > sc-codec-min-bin.js
```

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