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

0.5.0 • Public • Published

Zod to Avro.

Untested. Beta.

Pretty self explanatory.

npm install zod-avsc

Usage:

import { z } from "zod";
import { zodToAvro } from "zod-avsc";

const description = "Some values";
const zodValue = z.object(
  {
    name: z.string(),
    age: z.number(),
    address: z.object({
      street: z.string(),
      city: z.string(),
      state: z.string(),
      zip: z.string(),
    }),
  },
  { description }
);
const avroSchema = zodToAvro("Person", zodValue, { namespace: "com.acme.people" });

Readme

Keywords

none

Package Sidebar

Install

npm i zod-avsc

Weekly Downloads

2

Version

0.5.0

License

MIT

Unpacked Size

26.4 kB

Total Files

18

Last publish

Collaborators

  • mtranter