zod-metadata
Metadata support for Zod schemas.
Install
npm install zod-metadata
Usage
Automatic
Import zod-metadata/register
the top of your entry files:
JavaScript
require('zod-metadata/register');
TypeScript
import 'zod-metadata/register';
Manual
JavaScript
const { register } = require('zod-metadata');
const zod = require('zod');
register(zod);
TypeScript
import { register } from 'zod-metadata';
import zod from 'zod';
register(zod);
Preload
JavaScript
node -r zod-metadata/register my-script.js
require('zod-metadata');
TypeScript
ts-node -r zod-metadata/register my-script.js
import {} from 'zod-metadata';