Code Monkey home page Code Monkey logo

purepack's Introduction

purepack

A pure CoffeeScript implementation of Msgpack.

build status

Install

npm install purepack

Where To Use it

Tested and works with 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.

purepack's People

Contributors

maxtaco avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.