patched flow2schema
 
Go to file
Paul Loyd 3e989735ad Small docs fix 2017-11-05 15:17:35 +03:00
bin Project restructuring 2017-11-02 17:59:00 +03:00
lib Migrate to mocha 2017-11-05 12:28:10 +03:00
tests Migrate to mocha 2017-11-05 12:28:10 +03:00
.gitignore Add coverage 2017-11-05 01:13:56 +03:00
.travis.yml Add coverage 2017-11-05 01:13:56 +03:00
README.md Small docs fix 2017-11-05 15:17:35 +03:00
appveyor.yml Add appveyor and badges 2017-11-05 00:26:11 +03:00
package.json Small docs fix 2017-11-05 15:17:35 +03:00

README.md

flow2avro

Version npm Linux Build Windows Build Coverage Status

Example

Input:

$ ./bin/flow2avro -
    interface Foo {
        foo: string,
        // $avro long
        bar: number,
        opt: ?number,
        baz: 'one' | 'two',
        mix: 'one' | 'two' | number,
    }

Output:

[{
    type: 'record',
    name: 'Foo',
    namespace: 'example',
    fields: [
        { name: 'foo', type: 'string' },
        { name: 'bar', type: 'long' },
        { name: 'opt', type: [ 'null', 'double' ] },
        { name: 'baz', type: { type: 'enum', symbols: [ 'one', 'two' ] } },
        { name: 'mix', type: [
            'double',
            { type: 'enum', symbols: [ 'one', 'two' ] },
        ] },
    ],
}]

TODO

  • Generics.
  • Errors and warnings.
  • Support commonjs modules.
  • Documentation.