Add basic readme
parent
27629263c4
commit
61a47ce2ce
|
@ -0,0 +1,40 @@
|
|||
# flow2avro
|
||||
|
||||
## Example
|
||||
|
||||
Input:
|
||||
```javascript
|
||||
$ ./bin/flow2avro -
|
||||
interface Foo {
|
||||
foo: string,
|
||||
bar: ?number,
|
||||
baz: 'one' | 'two',
|
||||
mix: 'one' | 'two' | number,
|
||||
}
|
||||
```
|
||||
|
||||
Output:
|
||||
```javascript
|
||||
{
|
||||
Foo: {
|
||||
type: 'record',
|
||||
fields: [
|
||||
{ name: 'foo', type: 'string' },
|
||||
{ name: 'bar', type: [ 'null', 'double' ] },
|
||||
{ name: 'baz', type: { type: 'enum', symbols: [ 'one', 'two' ] } },
|
||||
{ name: 'mix', type: [
|
||||
'double',
|
||||
{ type: 'enum', symbols: [ 'one', 'two' ] }
|
||||
] }
|
||||
],
|
||||
name: 'Foo'
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## TODO:
|
||||
|
||||
* Tests.
|
||||
* Generics.
|
||||
* Namespaces.
|
||||
* Mixed type.
|
Loading…
Reference in New Issue