This project aims to create a library for reading and writing Avro-serialized data in Node.js applications.
It is currently basically functional, but not battle-tested in production yet.
In your Node project directory:
apt-get install cmake libboost-dev libboost-filesystem-dev libboost-system-dev libboost-program-options-dev
git clone git://github.com/collectivemedia/node-avro.git
cd node-avro
./bin/install-and-run-tests
cd ..
npm install node-avro
cmake -version
should be at least 2.8.9-rc1, we had problems with 2.8.0.
var avro = require("avro");
var schema = avro.prepareSchema("string");
var buffer = schema.encode("foo");
var value = schema.decode(buffer);
Creates a prepared schema object from a JS schema object, as defined in the Avro spec.
The encode
method of a schema object takes a JS value and returns a
binary buffer containing the Avro-encoded representation of the value.
The decode
method of a schema object takes a binary buffer
containing an Avro-encoded value and returns the decoded JS value.
node-avro is licensed under the MIT license.
Node-avro is created by Manuel Simoni (msimoni@gmail.com) for Collective Media, Inc.
Node-avro currently depends on a fork of the Avro C++ library. We are working on upstreaming our changes.