tamp
v0.0.3
Published
Encoder for the Tamper protocol
Downloads
79
Readme
Tamp
Tamp is an encoder for Tamper written in JavaScript. Tamper is a categorical data serialization protocol, for more info on, visit the Project Homepage.
Install
To install the latest pubished version, execute npm install tamp
in your terminal.
To install the latest development version, do this in your terminal:
git clone git://github.com/oztu/tamp.git
cd tamp
npm install
npm link
Usage
See a real example here.
var createTamp = require('tamp');
// Initialize tamp
var tamp = createTamp();
// Add a packed attribute
tamp.addAttribute({
attrName: FOR_EXAMPLE.attrName,
possibilities: FOR_EXAMPLE.possibilities,
maxChoices: FOR_EXAMPLE.maxChoices
});
// ... add more attributes perhaps ...
// Encode the data
tamp.pack(FOR_EXAMPLE.data);
// Get packed data
var myPackedData = tamp.toJSON();
More info
- Protocol specs
- Decoder (Unfortunately unstable as of April 21, 2014)