A zero-dependency instant JSON Schema and TypeScript declaration generator from raw JSON samples, files, or stdin.
Writing JSON Schema or TypeScript interfaces by hand for complex API responses is tedious.
schema-craft takes any JSON payload (or pipes from curl) and instantly crafts:
- JSON Schema Draft-07 with detected formats (
uuid,date-time, integers vs floats). - Clean TypeScript Interfaces with proper indentation and nested types.
# Generate JSON Schema from a file
npx schema-craft response.json
# Pipe curl directly to TypeScript types
curl -s https://api.github.com/users/luckdevx | npx schema-craft --ts --name GitHubUser
# Output to a file
npx schema-craft sample.json --ts --out src/types/api.d.tsMIT © luckdevx