{"id":16751698,"url":"https://github.com/lq782655835/json2ts","last_synced_at":"2026-05-16T23:12:14.153Z","repository":{"id":96217438,"uuid":"167334502","full_name":"lq782655835/json2ts","owner":"lq782655835","description":"automatically generate typescript definition file from url","archived":false,"fork":false,"pushed_at":"2020-01-17T15:07:23.000Z","size":1553,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-22T17:44:55.376Z","etag":null,"topics":["json2ts","tools","typescript"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/lq782655835.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":"2019-01-24T08:49:42.000Z","updated_at":"2023-11-05T15:26:02.000Z","dependencies_parsed_at":"2023-04-13T20:47:40.597Z","dependency_job_id":null,"html_url":"https://github.com/lq782655835/json2ts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fjson2ts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fjson2ts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fjson2ts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lq782655835%2Fjson2ts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lq782655835","download_url":"https://codeload.github.com/lq782655835/json2ts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243826784,"owners_count":20354222,"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":["json2ts","tools","typescript"],"created_at":"2024-10-13T02:44:39.494Z","updated_at":"2026-05-16T23:12:09.133Z","avatar_url":"https://github.com/lq782655835.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json2ts\n\nAutomatically generate typescript definition file from url\n\n![](https://github.com/lq782655835/json2ts/blob/master/json2ts.gif)\n## Install\n\n``` bash\nnpm install json2ts-core --save-dev\n```\n\n## Usage(CLI)\nyou can generate multiple ts definition files for api site，like [NEI](https://nei.netease.com/)(default). or generate single file for your single url address.\n\n```\njson2ts -u=your-web-url\n```\n\n```\n--version       Show version number                                   [boolean]\n  -u, --url       your web url                                        [required]\n  -m, --method    your web url method                           [default: \"get\"]\n  -t, --target    typescript interface target folder path       [default: \"./interfaces\"]\n  -p, --property  export response property interface\n  -h, --help      Show help                                           [boolean]\n```\n\n## Usage(API)\nyou can use api to parser user-defined rule.\n``` js\nconst json2ts = require('json2ts-core/src/json2ts')\n\njson2ts({url: 'http://localhost:8002'}, ($) =\u003e {\n  // your rule to parser page\n  $('selector').each(function(index, element) {\n    ...\n    arr.push({ url, method })\n  })\n  return arr\n})\n```\n\n## License\n\nThe code is distributed under the [MIT](http://opensource.org/licenses/MIT) license","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flq782655835%2Fjson2ts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flq782655835%2Fjson2ts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flq782655835%2Fjson2ts/lists"}