{"id":14969171,"url":"https://github.com/fastify/compile-schemas-to-typescript","last_synced_at":"2026-01-10T03:36:37.842Z","repository":{"id":36570791,"uuid":"226945163","full_name":"fastify/compile-schemas-to-typescript","owner":"fastify","description":"Compile JSON Schemas to TypeScript interfaces","archived":false,"fork":false,"pushed_at":"2024-02-08T17:04:48.000Z","size":22,"stargazers_count":7,"open_issues_count":2,"forks_count":3,"subscribers_count":19,"default_branch":"master","last_synced_at":"2024-09-28T11:21:35.703Z","etag":null,"topics":["fastify","fastify-library"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fastify.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":"fastify","open_collective":"fastify"}},"created_at":"2019-12-09T18:58:56.000Z","updated_at":"2022-08-05T02:09:48.000Z","dependencies_parsed_at":"2024-01-23T20:11:37.639Z","dependency_job_id":"5dcac0f2-a53c-49a9-9b26-a2cf3aca1ee5","html_url":"https://github.com/fastify/compile-schemas-to-typescript","commit_stats":{"total_commits":11,"total_committers":3,"mean_commits":"3.6666666666666665","dds":0.4545454545454546,"last_synced_commit":"21956fb5eec5bfa22302683042272105c1241a3a"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcompile-schemas-to-typescript","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcompile-schemas-to-typescript/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcompile-schemas-to-typescript/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fastify%2Fcompile-schemas-to-typescript/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fastify","download_url":"https://codeload.github.com/fastify/compile-schemas-to-typescript/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219869246,"owners_count":16555572,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["fastify","fastify-library"],"created_at":"2024-09-24T13:41:16.363Z","updated_at":"2025-10-19T09:32:18.419Z","avatar_url":"https://github.com/fastify.png","language":"JavaScript","funding_links":["https://github.com/sponsors/fastify","https://opencollective.com/fastify"],"categories":[],"sub_categories":[],"readme":"# Compile Schemas to TypeScript\n\nThis module is a wrapper around the `json-schema-to-typescript` library that enables transformation of directories of schemas instead of individual schemas. If directory support is added to the `json-schema-to-typescript` library this module will be archived.\n\n## CLI\n\nThis module works as an CLI. Install as a dependency and call `compile-schemas-to-typescript` from a npm script, or use `npx`\n\n```bash\nnpx compile-schemas-to-typescript \u003cschema-dir\u003e \u003ctypes-output-dir\u003e\n```\n\n## API\n\n`compileSchema(input: string, output: string): Promise\u003cvoid\u003e`\n\nThe method iterates over the contents of the `input` directory and compiles any `.json` files into TypeScript interfaces and stores the generated output into the specified `output` directory.\n\n```javascript\nconst compileSchemas = require('compile-schemas-to-typescript')\n\n(async () =\u003e {\n  try {\n    await compileSchemas('./schemas', './types')\n  } catch (err) {\n    console.error(err)\n    process.exit(1)\n  }\n})()\n```\n\n## Contributing\n\nThis project is actively maintained by the Fastify team.\n\nContributions are welcome! Please open an issue and a pull request.\n\n## License\n\nLicensed under [MIT](./LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Fcompile-schemas-to-typescript","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffastify%2Fcompile-schemas-to-typescript","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffastify%2Fcompile-schemas-to-typescript/lists"}