🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
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
npm
Version published
Weekly downloads
204
98.06%
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