2.1.3 • Published 9 months ago

zod-to-protobuf v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

zod-to-protobuf

NPM Version NPM Downloads

Summary

Convert Zod schemas to Protocol Buffers definitions.

Installation

npm install zod-to-protobuf

Usage

import { z } from 'zod'
import { zodToProtobuf } from 'zod-to-protobuf'

const schema = z.object({
    name: z.string(),
    age: z.number()
})

const proto = zodToProtobuf(schema)
console.log(proto)

Expected Output

syntax = "proto3";
package default;

message Message {
    string name = 1;
    double age = 2;
}

Options

OptionDescriptionDefault
packageNameName of the protobuf packagedefault
rootMessageNameName of the protobuf messageMessage
typePrefixPrefix for each type(empty string)

Contributing

Contributions are welcome! Please open an issue or submit a pull request.

2.1.2

9 months ago

2.1.3

9 months ago

2.1.1

12 months ago

2.1.0

12 months ago

2.0.0

12 months ago

1.0.4

12 months ago

1.0.3

12 months ago

1.0.2

12 months ago

1.0.1

12 months ago

1.0.0

12 months ago