avsc-tsc
TypeScript icon, indicating that this package has built-in type declarations

1.0.6 • Public • Published
Avro logo

Avro TSC Decorators

Installation

npm install avsc-tsc

Usage

  • Decorators
import { Avro, AvroField, AvroSchema } from 'avsc-tsc';

@AvroSchema({ namespace: 'evm' })
class Block extends Avro {
  @AvroField(['string', 'null'])
  number: number

  @AvroField(['string', 'null'])
  hash: number
}
  • Encoding
const block = new Block()
const encoded = await block.encode()
  • Decoding
const decoded = await Block.decode<Block>(encoded)

/avsc-tsc/

    Package Sidebar

    Install

    npm i avsc-tsc

    Weekly Downloads

    161

    Version

    1.0.6

    License

    ISC

    Unpacked Size

    20 kB

    Total Files

    11

    Last publish

    Collaborators

    • rphansen91