avro-schema

0.0.3 • Public • Published

node-avro

Verify that JSON objects match schemas & encode them to AVRO binary.

    var schema = new require('avro-schema').Schema();
    schema.load("myfile.avsc");
    // All types from myfile.avsc are available.
    schema.load("another.avsc");
    // Verifies that object o matches the schema from another.avsc
    schema.verify(o);
    // Verifies that object o matches a particular type name.
    schema.verify(o, 'MyFileType');
    // Now encode it to avro binary format.
    var buffer = schema.encode(o);

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.0.3
    4
    • latest

Version History

  • Version
    Downloads (Last 7 Days)
    • Published
  • 0.0.3
    4
  • 0.0.2
    0
  • 0.0.1
    0

Package Sidebar

Install

npm i avro-schema

Weekly Downloads

4

Version

0.0.3

License

none

Last publish

Collaborators

  • nsabovic