0.1.4 • Published 7 years ago

avroize-es6 v0.1.4

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

avroize-es6

Build Status Coverage Status npm version

Transform your data into valid Avro JSON for any given Avro schema.

Support for MVP release:

  • Primitive types: Boolean, Double, Float, Integer, Long, String
  • Complex types: Arrays, Records, Unions (null only)
  • JSON Avroizer

Getting Started

Install Avroize using npm:

npm install --save avroize-es6

Avroize JSON data:

import {getJSONAvroizer} from 'avroize-es6'

const avroSchema = {
    "name": "example",
    "namespace": "avro.test",
    "type": "record",
    "fields":[{
        "default": "",
        "name": "field1",
        "type": "string"
    },{
        "default": null,
        "name": "field2",
        "type": ["null", "string"]
    }]
};

const avroizer = getJSONAvroizer(avroSchema);

const result = avroizer.avroize({"field1":"test"});

console.log(result); // {"field1": "test", "field2": null}
0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago