Convert JSON Schema definitions to Valibot schema definitions. Version 0.3.1, actively maintained. Inspired by json-schema-to-zod, this library provides both a CLI and programmatic API for converting JSON schemas (including $ref, enums, string formats, and recursive schemas) into Valibot code. Supports ESM and CJS output, optional TypeScript type generation, and extensive JSON Schema features. Differentiator: dedicated Valibot conversion with same ergonomics as json-schema-to-zod.
npm install json-schema-to-valibotNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Converts a JSON Schema object to a Valibot schema string with TypeScript types.
Use npx json-schema-to-valibot or install globally with npm install -g json-schema-to-valibot
Use --module cjs for CommonJS output if needed.
Set exportDefinitions: true explicitly if you rely on exported definitions.
Use --with-types instead of --types.
Run 'npm install json-schema-to-valibot' or 'pnpm install json-schema-to-valibot'.
Use import statement instead of require().
Use named import: import { jsonSchemaToValibot } from 'json-schema-to-valibot'Use one of: esm, cjs, none
Ensure all referenced definitions are included in the schema under definitions or $defs.