{"id":23324481,"url":"https://github.com/hacxy/json2typebox","last_synced_at":"2025-08-22T18:32:37.889Z","repository":{"id":260102557,"uuid":"878751411","full_name":"hacxy/json2typebox","owner":"hacxy","description":"Creating TypeBox code from Json Data","archived":false,"fork":false,"pushed_at":"2024-10-31T12:00:48.000Z","size":229,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-03T01:37:20.135Z","etag":null,"topics":["json2typebox","typebox","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hacxy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"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}},"created_at":"2024-10-26T02:45:32.000Z","updated_at":"2024-11-04T16:34:18.000Z","dependencies_parsed_at":"2024-10-29T15:18:00.759Z","dependency_job_id":null,"html_url":"https://github.com/hacxy/json2typebox","commit_stats":null,"previous_names":["hacxy/json2typebox"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Fjson2typebox","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Fjson2typebox/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Fjson2typebox/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hacxy%2Fjson2typebox/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hacxy","download_url":"https://codeload.github.com/hacxy/json2typebox/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230626766,"owners_count":18255690,"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":["json2typebox","typebox","typescript"],"created_at":"2024-12-20T18:16:49.532Z","updated_at":"2025-08-22T18:32:37.869Z","avatar_url":"https://github.com/hacxy.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Json2Typebox\n\nIf you need cli tools. see [json2typebox-cli](https://github.com/hacxy/json2typebox-cli).\n\n## Overview\n\nJson2Typebox is a code generation tool that transforms Json Data into [TypeBox](https://github.com/sinclairzx81/typebox) type.\n\nBrowsers and Node.js can both be used.\n\n## Install\n\n```bash\nnpm install json2typebox --save\n```\n\n### Example\n\n```ts\nimport json2typebox from 'json2typebox';\n\nawait json2typebox('{\"id\": 1, \"name\": \"hacxy\"}', 'Root');\n\n/*\n    import { Type, Static } from '@sinclair/typebox'\n\n    export type Data = Static\u003ctypeof Data\u003e\n    export const Data = Type.Object({\n      id: Type.Number(),\n      name: Type.String()\n    })\n */\n```\n\nfunction: `json2typebox()`\n\n\u003e **json2typebox**(`json`, `name`): `Promise`\\\u003c`string`\\\u003e\n\n### Params\n\n| name   | types    | default     | description      |\n| :----- | :------- | :---------- | :--------------- |\n| `json` | `string` | `undefined` | json data        |\n| `name` | `string` | `'Root'`    | define type name |\n\n### Returns\n\n`Promise`\\\u003c`string`\\\u003e\n\n## Related\n\n- json2typebox-cli: [https://github.com/hacxy/json2typebox-cli](https://github.com/hacxy/json2typebox-cli)\n- json2ts: [https://github.com/hacxy/json2ts](https://github.com/hacxy/json2ts)\n\n## License\n\n[MIT](./LICENSE) License \u0026copy; 2023-PRESENT [Hacxy](https://github.com/hacxy)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacxy%2Fjson2typebox","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhacxy%2Fjson2typebox","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhacxy%2Fjson2typebox/lists"}