You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

avsc-tsc

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

avsc-tsc

Utility library to encode and decode typescript classes in Avro format

1.0.6
latest
npmnpm
Version published
Weekly downloads
256
-16.88%
Maintainers
1
Weekly downloads
 
Created
Source
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)

FAQs

Package last updated on 12 Aug 2022

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts