All Projects → bornfight → avro-to-typescript

bornfight / avro-to-typescript

Licence: MIT license
Compile Apache Avro schema files to TypeScript classes

Programming Languages

typescript
32286 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to avro-to-typescript

xml-avro
Convert XSD -> AVSC and XML -> AVRO
Stars: ✭ 32 (+3.23%)
Mutual labels:  converter, avro
osx-callhistory-decryptor
macOS (incl big sur) call history decryptor/converter to CSV format.
Stars: ✭ 19 (-38.71%)
Mutual labels:  converter
DataProfiler
What's in your data? Extract schema, statistics and entities from datasets
Stars: ✭ 843 (+2619.35%)
Mutual labels:  avro
Create-EXEFromPS1
Takes one PowerShell script and any number of supplementary files or even a directory and creates an exe using Windows's built in iexpress program. The exe will run on any machine with PowerShell 2.0+.
Stars: ✭ 81 (+161.29%)
Mutual labels:  converter
can2mqtt
Bidirectional CAN-Bus to MQTT-Bridge
Stars: ✭ 39 (+25.81%)
Mutual labels:  converter
svg2ass
Svg2ass - convert SVG vector graphics to ASS subtitle draw instructions.
Stars: ✭ 22 (-29.03%)
Mutual labels:  converter
Video-to-audio-converter
A simple tool to convert video files into mp3 audio files
Stars: ✭ 40 (+29.03%)
Mutual labels:  converter
jsons2xsd
Highly configurable converter from JSON-schema to XML-schema (XSD).
Stars: ✭ 65 (+109.68%)
Mutual labels:  converter
convertron3000
Convertron3000 commodore 64 graphics converter
Stars: ✭ 24 (-22.58%)
Mutual labels:  converter
tyson
A TypeScript serialization/deserialization library to convert objects to/from JSON
Stars: ✭ 25 (-19.35%)
Mutual labels:  converter
avrocount
Count records in Avro files efficiently
Stars: ✭ 16 (-48.39%)
Mutual labels:  avro
express-to-koa
Use express middlewares in Koa2, the one that really works.
Stars: ✭ 18 (-41.94%)
Mutual labels:  converter
LC2KiCad
A C++ utility that converts EasyEDA (LCEDA) file to KiCad 5 Documents.
Stars: ✭ 103 (+232.26%)
Mutual labels:  converter
schema-registry
📙 json & avro http schema registry backed by Kafka
Stars: ✭ 23 (-25.81%)
Mutual labels:  avro
i7n-pdfhtml
pdfHTML is an iText 7 add-on for C# (.NET) that allows you to easily convert HTML and CSS into standards compliant PDFs that are accessible, searchable and usable for indexing.
Stars: ✭ 111 (+258.06%)
Mutual labels:  converter
svg2polylines
Rust library to convert SVG data to a list of flattened polylines. Also includes FFI bindings.
Stars: ✭ 16 (-48.39%)
Mutual labels:  converter
unicode-formatter
Convert portions of text to fancy text using unicode fonts for use on Twitter and other sites that don't support rich text
Stars: ✭ 31 (+0%)
Mutual labels:  converter
o2d3m
Wavefront OBJ to Doom3 map converter.
Stars: ✭ 15 (-51.61%)
Mutual labels:  converter
to-json-schema
Converts JS objects to JSON Schema
Stars: ✭ 83 (+167.74%)
Mutual labels:  converter
avro-parser-haskell
Language definition and parser for AVRO (.avdl) files.
Stars: ✭ 14 (-54.84%)
Mutual labels:  avro

avro-to-typescript

Build Status npm version

avro-to-typescript compiles avro schema files (.avsc) to TypeScript classes and interfaces. Making using avro schematics with node.js easy and comfortable.

Features

  • Compiles most if not all avro types (record, enum, primitive, map, array)
  • Provides methods for effective serialization and deserialization of avro to js and vice versa

Usage

Global:

Most projects will use avro-to-typescript this way

npm install -g @degordian/avro-to-typescript

avro-to-typescript --compile [ schema-directory ] [ output-directory ]

This will generate namespaced folders and files for your schemas inside output directory so have that in mind.

You also need to install avro-to-typescript in your project.

npm install @degordian/avro-to-typescript --save

Project:

This way is if your projects needs to generate avro classes while running.

npm install @degordian/avro-to-typescript --save
import { Compiler } from "degordian/avro-to-typescript";

const compiler = new Compiler(outputDir);
await compiler.compile(avro);

Logical Types:

If you want to take advantage of logical types, you can pass these as an argument to the cli

avro-to-typescript --compile [ schema-directory ] [ output-directory ] --logical-types [avro type] [typescript type]

You can even pass more than one if you alternate them:

avro-to-typescript --compile [ schema-directory ] [ output-directory ] --logical-types [avro type] [typescript type] [avro type] [typescript type]

You can also pass them to the compilre in your code directly:

import { Compiler } from "degordian/avro-to-typescript";

const compiler = new Compiler(outputDir, { date: 'string', 'timestamp-millis': 'string'} });
await compiler.compile(avro);

If there are logical types in the avro schema but you don't provide a mapping for them, they will default to the underlying primitive type.

Contribution and Support

If you are having issues, please let us know on our issue tracker.

  • Issue Tracker: github.com/degordian/avro-to-typescript/issues
  • Source Code: github.com/degordian/avro-to-typescript

License

The project is licensed under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].