# @via-org/avsc

> A via-specific pure JavaScript implementation of the [Avro specification](https://avro.apache.org/docs/current/spec.html). Used for [bundling data](https://github.com/joshbenaron/arweave-standards/blob/ans104/ans/ANS-104.md).

Latest version **6.1.8** (published 2022-03-01) · 0 weekly downloads

## Install

```sh
npm install @via-org/avsc
pnpm add @via-org/avsc
yarn add @via-org/avsc
bun add @via-org/avsc
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 6.1.8 |
| Published | 2022-03-01 |
| First published | 2022-02-27 |
| Weekly downloads | 0 |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 32.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | hbauer |

## Links

- npm: https://www.npmjs.com/package/@via-org/avsc
- Repository: https://github.com/handlebauer/avsc
- Homepage: https://github.com/handlebauer/avsc#readme
- Issues: https://github.com/handlebauer/avsc/issues
- npm.io page: https://npm.io/package/@via-org/avsc

## Recent versions

- 6.1.8 (latest) — 2022-03-01
- 6.1.7 — 2022-03-01
- 6.1.6 — 2022-03-01
- 6.1.5 — 2022-02-27
- 6.1.4 — 2022-02-27
- 6.1.3 — 2022-02-27

## README

# avsc

A via-specific pure JavaScript implementation of the [Avro specification](https://avro.apache.org/docs/current/spec.html). Used for [bundling data](https://github.com/joshbenaron/arweave-standards/blob/ans104/ans/ANS-104.md).

## Features

- Isomorphic: no reliance on node built-ins

## Installation

```bash
$ npm install @via-org/avsc
# or
$ yarn add @via-org/avsc
```

## Example

```js
import { createType } from '@via-org/avsc'

export const Tags = createType({
  type: 'array',
  items: createType({
    type: 'record',
    name: 'Tag',
    fields: [
      { name: 'name', type: 'string' },
      { name: 'value', type: 'string' },
    ],
  }),
})

// Encode
const tags = [{ name: 'Tag-Name', value: 'Tag-Value' }]
const encodedTags = Tags.toBuffer(tags) // encodedTags instanceof Uint8Array

// Decode
const decodedTags = Tags.fromBuffer(encodedTags) // decodedTags === tags
```

---
_Source: https://npm.io/package/@via-org/avsc · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
