# purepack

> A browserify, Pure JS implementation of msgpack spec v5

Latest version **1.0.6** (published 2020-01-27) · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2020-01-27 |
| First published | 2013-01-23 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=0.10.0 |
| Dependencies | 0 |
| Unpacked size | 126.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Maintainers | maxtaco |

## Links

- npm: https://www.npmjs.com/package/purepack
- Repository: https://github.com/keybase/purepack
- Issues: https://github.com/maxtaco/purepack/issues
- npm.io page: https://npm.io/package/purepack

## Recent versions

- 1.0.6 (latest) — 2020-01-27
- 1.0.5 — 2019-02-01
- 1.0.4 — 2015-09-03
- 1.0.3 — 2015-08-06
- 1.0.2 — 2015-08-06
- 1.0.1 — 2014-05-29
- 1.0.0 — 2013-10-02
- 0.0.21 — 2013-09-30
- 0.0.20 — 2013-05-29
- 0.0.19 — 2013-05-20
- 0.0.18 — 2013-05-16
- 0.0.17 — 2013-05-09
- 0.0.16 — 2013-05-08
- 0.0.15 — 2013-05-07
- 0.0.14 — 2013-05-07
- … 18 more at https://npm.io/package/purepack/versions

## README

purepack
========

A pure CoffeeScript implementation of Msgpack.

[![build status](https://secure.travis-ci.org/maxtaco/purepack.png)](http://travis-ci.org/maxtaco/purepack)

## Install

    npm install purepack

## Where To Use it

Tested and works with [browserify](https://github.com/substack/node-browserify), so
it's useful for packing and unpacking structures on the browser-side.  It also works
server-side in `node` processes.  In either case, it finds the fastest buffer
objects at its disposal to give you the best performance possible.

## API

### purepack.pack(obj,opts)

Pack an object `obj`. Return a `Buffer` object.

##### opts

Options currently supported, off by default:

* `floats` — Use floats rather than doubles when encoding.  Useful when saving space
* `sort_keys` - Sort the keys of maps on outputs, so that purepack output can be compared in hashes.
* `ext` - An 'extensible-type' function.
* `no_str8` - Don't use 8-bit string encodings, to maintain compatibility with older msgpacks.

### purepack.unpack(buf,opts)

Unpack a packed `Buffer buf`. Throws errors if there were underruns, or bad encodings.
 
##### opts

Currently support options are:

* `ext` - An `extensible-type` function that given a `[type,buf]` tuple, returns
an object. Can throw an error if needs be.
* `no_ext` - If no `ext` option is given, we plug in a default, stupid-ish
`ext` function. Supply this flag if you don't want that.

## Building

    make setup
    make

## Testing

    make setup
    make
    make test

Testing will run a series of scripts on your machine using `node`.  It also will
ask you to visit a URL with whichever browsers you please to test `purepack` 
use via `browserify` and with your browser's buffer objects.

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