2.1.3 • Published 10 months ago

zod-to-protobuf v2.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
10 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

10 months ago

2.1.3

10 months ago

2.1.1

1 year ago

2.1.0

1 year ago

2.0.0

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago