sankethkatta / avsc

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Avsc

Pure JavaScript implementation of the Avro specification.

What's already there:

  • Parsing schemas.
  • Encoding, decoding, validating, and generating data.
  • Resolving schemas (a.k.a. "reader's schemas").
  • Reading container files.

Coming up:

  • Writing container files.
  • Sort order.
  • Canonical schemas and fingerprints.
  • Protocols.

Example

var avsc = require('avsc');

var Person = avsc.parse({
  type: 'record',
  name: 'Person',
  fields: [
    {name: 'name', type: 'string'},
    {name: 'age', type: 'int'}
  ]
}).getRecordConstructor();

var person = new Person('Ann', 25);
person.name; // == 'Ann'
person.age; // == 25
person.$encode(); // Buffer containing this record's Avro encoding.

Installation

$ npm install avsc

Documentation

About


Languages

Language:JavaScript 100.0%