{"id":21262883,"url":"https://github.com/stackql/generate-types","last_synced_at":"2025-07-11T04:31:25.743Z","repository":{"id":60891274,"uuid":"546465059","full_name":"stackql/generate-types","owner":"stackql","description":"Deno module to generate a TypeScript types module file from JSON data (or a parsed JSON string).","archived":false,"fork":false,"pushed_at":"2022-10-07T03:51:01.000Z","size":8,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-05-01T11:44:46.527Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/stackql.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}},"created_at":"2022-10-06T05:49:07.000Z","updated_at":"2023-02-24T04:16:27.000Z","dependencies_parsed_at":"2023-01-19T14:45:19.085Z","dependency_job_id":null,"html_url":"https://github.com/stackql/generate-types","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fgenerate-types","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fgenerate-types/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fgenerate-types/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/stackql%2Fgenerate-types/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/stackql","download_url":"https://codeload.github.com/stackql/generate-types/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225674895,"owners_count":17506272,"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":[],"created_at":"2024-11-21T04:59:38.409Z","updated_at":"2024-11-21T04:59:39.027Z","avatar_url":"https://github.com/stackql.png","language":"TypeScript","readme":"# 🦕 generate-types\n\n[![deno.land/x/dts](https://shield.deno.dev/x/dts)](https://deno.land/x/dts)\n![workflow](https://github.com/stackql/generate-types/actions/workflows/deno.yml/badge.svg)\n\nDeno module to generate a TypeScript types module file from JSON data (or a\nparsed JSON string).\n\n## Usage\n\n```typescript\nimport { generateTypes } from \"https://deno.land/x/dts/mod.ts\";\n\nasync function main() {\n  const jsonString = `{\n    \"external_urls\": {\n        \"spotify\": \"https://open.spotify.com/artist/4Z8W4fKeB5YxbusRsdQVPb\"\n    },\n    \"followers\": {\n        \"href\": null,\n        \"total\": 7405000\n    },\n    \"genres\": [\n        \"alternative rock\",\n        \"art rock\",\n        \"melancholia\",\n        \"oxford indie\",\n        \"permanent wave\",\n        \"rock\"\n    ],\n    \"href\": \"https://api.spotify.com/v1/artists/4Z8W4fKeB5YxbusRsdQVPb\",\n    \"id\": \"4Z8W4fKeB5YxbusRsdQVPb\",\n    \"name\": \"Radiohead\",\n    \"popularity\": 79,\n    \"type\": \"artist\",\n    \"uri\": \"spotify:artist:4Z8W4fKeB5YxbusRsdQVPb\"\n  }`;\n  \n    const inputObject = JSON.parse(jsonString);\n    const result = await generateTypes(inputObject);\n    console.log(result);\n}\n\nmain();\n```\n\noutputs...\n\n```\ndeclare module namespace {\n\n  export interface IRootObject {\n    IExternal_urls: object\n    IFollowers: object\n    genres: string[]\n    href: string\n    id: string\n    name: string\n    popularity: number\n    type: string\n    uri: string\n  }\n\n  export interface IExternal_urls {\n    spotify: string\n  }\n\n  export interface IFollowers {\n    href: any\n    total: number\n  }\n\n}\n```\n\n## Test\n\n```bash\ndeno test\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fgenerate-types","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fstackql%2Fgenerate-types","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fstackql%2Fgenerate-types/lists"}