typeconv is a fast, bidirectional type conversion utility that converts between JSON Schema, TypeScript, GraphQL, Open API, and SureType. Version 2.3.1 is the latest stable release. It uses the core-types ecosystem to preserve comments, descriptions, and source locations across conversions. Unlike ad-hoc converters, typeconv provides a unified API and CLI for all supported formats, with high performance and CLI glob support. It is a pure ESM package (no CommonJS) and requires Node.js >= 14.13.1.
npm install typeconvNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Shows how to use the API to convert JSON Schema to TypeScript.
Use ESM imports (import) or migrate to Node >= 14.13.1. CLI usage unaffected.
Update to v2 API: call typeconv with options object instead of positional arguments.
Use quotes: typeconv -f ts -t gql -o output 'src/**/*.ts'
Check resulting types; JSON Schema constraints (e.g., minLength) are not representable in GraphQL.
Switch to import statement (import { typeconv } from 'typeconv') or use dynamic import().Ensure correct import: import { typeconv } from 'typeconv'. v2 API is typeconv({ from, to, data }).Quote the glob pattern in CLI: typeconv -f ts -t gql -o output 'types/**/*.ts'
Use one of the supported types: json-schema, typescript, graphql, open-api, suretype.