Skip to content
C++ JavaScript Shell
Find file
Pull request Compare This branch is 7 commits behind collectivemedia:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
avro-cpp @ e2c70f5
bin
lib
test
.gitmodules
LICENSE
README.md
binding.gyp
node_avro.cc
package.json

README.md

node-avro: Avro serialization format support for Node.js

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.

Install on Debian/Ubuntu

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.

API

Example

var avro = require("avro");
var schema = avro.prepareSchema("string");
var buffer = schema.encode("foo");
var value = schema.decode(buffer);

avro.prepareSchema(<object>) -> <schema>

Creates a prepared schema object from a JS schema object, as defined in the Avro spec.

<schema>.encode(<value>) -> <buffer>

The encode method of a schema object takes a JS value and returns a binary buffer containing the Avro-encoded representation of the value.

<schema>.decode(<buffer>) -> <value>

The decode method of a schema object takes a binary buffer containing an Avro-encoded value and returns the decoded JS value.

Licensing

node-avro is licensed under the MIT license.

Contact

Node-avro is created by Manuel Simoni (msimoni@gmail.com) for Collective Media, Inc.

Notes

Node-avro currently depends on a fork of the Avro C++ library. We are working on upstreaming our changes.

Something went wrong with that request. Please try again.