{"id":15368171,"url":"https://github.com/hubvue/json2type","last_synced_at":"2025-09-08T00:15:35.634Z","repository":{"id":57643034,"uuid":"437577531","full_name":"hubvue/json2type","owner":"hubvue","description":"convert JSON of a specific format to a type structure(support Typescript type and Go type)","archived":false,"fork":false,"pushed_at":"2023-12-15T11:53:01.000Z","size":4169,"stargazers_count":4,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-10T20:39:59.611Z","etag":null,"topics":["convert","go","json","typescript"],"latest_commit_sha":null,"homepage":"https://blog.cckim.cn/tools/json2type","language":"Go","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/hubvue.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":"hubvue"}},"created_at":"2021-12-12T15:07:04.000Z","updated_at":"2023-03-11T15:39:56.000Z","dependencies_parsed_at":"2024-06-20T04:39:29.616Z","dependency_job_id":"ce352896-13c6-4259-8d08-d20c40b8ab2c","html_url":"https://github.com/hubvue/json2type","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/hubvue/json2type","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubvue%2Fjson2type","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubvue%2Fjson2type/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubvue%2Fjson2type/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubvue%2Fjson2type/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hubvue","download_url":"https://codeload.github.com/hubvue/json2type/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hubvue%2Fjson2type/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274113690,"owners_count":25224459,"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","status":"online","status_checked_at":"2025-09-07T02:00:09.463Z","response_time":67,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["convert","go","json","typescript"],"created_at":"2024-10-01T13:28:32.137Z","updated_at":"2025-09-08T00:15:35.458Z","avatar_url":"https://github.com/hubvue.png","language":"Go","funding_links":["https://github.com/sponsors/hubvue"],"categories":[],"sub_categories":[],"readme":"# json2type\nconvert JSON of a specific format to a type structure(support Typescript type and Go type)\n\n\n## Quick Start\n\n### CLI\n\n#### Install\n\nuse go tool install\n\n```shell\ngo install github.com/hubvue/json2type/json2type@latest\n```\n\nuse npm/yarn/pnpm install\n```shell\n# npm\nnpm install @cckim/json2type -g\n# yarn\nyarn global add @cckim/json2type\n# pnpm\npnpm add @cckim/json2type --global\n```\n#### Usage\n\n```shell\njson2type help\n```\n\n```txt\nUsage of json2type:\n  -input string\n    \tthe file of the json file(input parameter is required)\n  -language string\n    \tused to convert json to the type of the language(typescript by default) (default \"typescript\")\n  -name string\n    \tthe name of the type name(auto by default) (default \"auto\")\n  -output string\n    \tthe name of the file to write the output to (outputs to stdout by default)\n```\n\n```shell\njson2type -input=tmp.json\n```\n\n##### Example\n```json\n{\n  \"name\": \"hubvue\",\n  \"age\": 18\n}\n```\nResult:\n```ts\ninterface Auto {\n    name: string\n    age: number\n}\n```\n\n### Package\n\n```shell\ngo get github.com/hubvue/json2type\n```\n#### Usage\n\n```go\npackage main\nimport (\n\t\"fmt\"\n\t\"github.com/hubvue/json2type\"\n)\n\nfunc main() {\n\tfileJson, _ := ioutil.ReadFile(jsonFile)\n\tcode, _ := json2type.Parser(fileJson, \"typescript\", \"typeName\")\n\tfmt.Println(code)\n}\n```\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubvue%2Fjson2type","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhubvue%2Fjson2type","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhubvue%2Fjson2type/lists"}