upair
v0.0.4
Published
Like JSON but stored as binary underneat, used for direct commnicate with RESTful server
Downloads
3
Readme
vsjs-upair
upair
convert Javascript Object into binary format,
developed for communicate with vasern-server
.
Since data is stored as binary in data file, by using binary format data, we can avoid format data in the server (which reduce server work load).
Note: server will also needs a upair
parser to convert binary to object-like type
Example
import UPAIR from 'vsjs-upair';
var jsObject = {
id: "0b5bab884453136ec8b",
name: "Peter",
yearOfBirth: 1984
};
// Convert to binary format (ArrayBuffer)
var arrayBuffer = UPAIR.toBuffer(jsObject);
// Convert back to JavaScript Object
var parsedJsObject = UPAIR.parse(arrayBuffer);
Installation
upair
is available as a NPM package name vsjs-upair
$ npm install vsjs-upair
# or using yarn
$ yarn add vsjs-upair
Feedback and contribution are welcome