Skip to content
Go to file

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time

HiPack (de)serialization library in JavaScript

Builld status

JavaScript module to work with the HiPack serialization format. The implementation and API are intentionally simple.


  • Reading and writing HiPack formatted messages.
  • Works in NodeJS and browsers.
  • Small, self contained JavaScript implementation.
  • Less than 8kB when minified using UglifyJS2!


For Node, npm can be used to install the module:

npm install hipack-js

A hipack-js package is also available to be used with Bower:

bower install hipack-js


(The following examples use Node.)

First, import the module:

var hipack = require("hipack")

To serialize an object containing data, use hipack.dump():

var hiPackText = hipack.dump({
  authors: [
    { name: "Adrián Pérez", email: "" },
    { name: "John Doe", email: "" },

The call to will output the following

authors [
     email: ""
     name: "Adrián Pérez"
    email: ""
    name: "John Doe"

Optionally, pass true as a second parameter to hipack.dump() in order to generate a “compact” representation of the data with indentation and whitespace removed, all in a single line.

Parsing is done using the hipack.load() function:

var data = hipack.load(hiPackText);

Browser Usage

The hipack.js script can be directly used with a <script> tag (a minified version is also available):

<!-- This creates a global "hipack" object -->
<script type="text/javascript" src="hipack.js"></script>

If the hipack global name needs to be used for other purposes, a hipack.noConflict() function is provided, which will restore its previous value and return the hipack object:

<script type="text/javascript">
  var myHiPack = hipack.noConflict();
  // Now the API functions are in "myHiPack"
  var data = myHiPack.load( ... );


HiPack (de)serialization library in JavaScript



No packages published
You can’t perform that action at this time.