{"id":20692056,"url":"https://github.com/richie-south/typescript-type-generator","last_synced_at":"2025-06-26T11:33:10.071Z","repository":{"id":57383826,"uuid":"155589607","full_name":"richie-south/typescript-type-generator","owner":"richie-south","description":"Generate interfaces on the go! Network request? Then generate interfaces for response!","archived":false,"fork":false,"pushed_at":"2018-12-03T08:30:32.000Z","size":412,"stargazers_count":18,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-25T19:19:15.787Z","etag":null,"topics":["interface","interface-builder","npm","types","typescript"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/typescript-interface-generator","language":"JavaScript","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/richie-south.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-10-31T16:29:09.000Z","updated_at":"2022-07-14T15:42:39.000Z","dependencies_parsed_at":"2022-09-14T04:10:27.086Z","dependency_job_id":null,"html_url":"https://github.com/richie-south/typescript-type-generator","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/richie-south/typescript-type-generator","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richie-south%2Ftypescript-type-generator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richie-south%2Ftypescript-type-generator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richie-south%2Ftypescript-type-generator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richie-south%2Ftypescript-type-generator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/richie-south","download_url":"https://codeload.github.com/richie-south/typescript-type-generator/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/richie-south%2Ftypescript-type-generator/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262056366,"owners_count":23251668,"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":["interface","interface-builder","npm","types","typescript"],"created_at":"2024-11-16T23:19:00.619Z","updated_at":"2025-06-26T11:33:10.028Z","avatar_url":"https://github.com/richie-south.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# typescript-type(interface)-generator\n\nGenerate interfaces form javascript objects\n\n## install\n\n```\nnpm install typescript-interface-generator\n```\n\n## example\n\n```javascript\n\nimport { createInterfacesFromObject } from 'typescript-interface-generator'\n\nconst code = createInterfacesFromObject(\n  'User',\n  {\n    id: 1,\n    data: {\n      name: 'Richard',\n      articles: [\n        {\n          id: 0,\n          title: 'article 0',\n        },\n        {\n          id: 0,\n          title: 'article 0',\n        },\n        {\n          anotherObject: 10,\n        },\n      ],\n    },\n  }\n)\n\nconsole.log(code)\n/**\n ** CODE OUTPUT **\n\n interface User {\n    id: number;\n    data: Data;\n  }\n\n  interface Data {\n    name: string;\n    articles: Array\u003cArticles | Articles1\u003e;\n  }\n\n  interface Articles {\n    id: number;\n    title: string;\n  }\n\n  interface Articles1 {\n    anotherObject: number;\n  }\n */\n\n```\n\n## API\n\n### createInterfacesFromObject\n\nTakes a name and a javascript object and returns a string with typescript interfaces\n\n**Syntax**\n\n```javascript\n  import { createInterfacesFromObject } from 'typescript-interface-generator'\n\n  createInterfacesFromObject('NAME', {})\n```\n\n***Parameters***\n\n* string\n  * name of (parent) interface\n* object\n  * object that should be turned to interfaces\n\n***Return value***\n\nstring: contains typescript interfaces\n\n## gif example\n\n\u003cimg src=\"https://github.com/richie-south/typescript-type-generator/blob/master/media/showcase.gif\" width=\"500\"\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichie-south%2Ftypescript-type-generator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frichie-south%2Ftypescript-type-generator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frichie-south%2Ftypescript-type-generator/lists"}