{"id":18474640,"url":"https://github.com/ayayem/json-typings","last_synced_at":"2026-04-20T13:04:32.462Z","repository":{"id":143979061,"uuid":"438537523","full_name":"AyAyEm/json-typings","owner":"AyAyEm","description":"Generate typescript typings from JSON files.","archived":false,"fork":false,"pushed_at":"2021-12-18T23:32:21.000Z","size":4394,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-16T19:34:25.381Z","etag":null,"topics":["json","rust","typescript"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/AyAyEm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","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":"2021-12-15T07:36:43.000Z","updated_at":"2021-12-18T23:32:24.000Z","dependencies_parsed_at":null,"dependency_job_id":"244ef203-5df9-45b2-b6e0-7849ca775efa","html_url":"https://github.com/AyAyEm/json-typings","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/AyAyEm%2Fjson-typings","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyAyEm%2Fjson-typings/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyAyEm%2Fjson-typings/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AyAyEm%2Fjson-typings/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AyAyEm","download_url":"https://codeload.github.com/AyAyEm/json-typings/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253960312,"owners_count":21990842,"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":["json","rust","typescript"],"created_at":"2024-11-06T10:30:09.105Z","updated_at":"2026-04-20T13:04:32.419Z","avatar_url":"https://github.com/AyAyEm.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# json-typings\n\nFast and highly configurable JSON typescript typings generator.\n\n## Features\n\n- Template string compatibility\n- Interface key sorting\n- Support for Array or Object in json file\n- Multiple output strategies\n- Highly configurable\n\n## Usage\n\n```none\njsontypings [FLAGS] [OPTIONS] \u003cINPUT_FILE\u003e\n```\n\n### Options\n\n- `-c, --config \u003cFILE\u003e` Sets a custom config file\n- `-d, --delimiter \u003cSTRING\u003e` Defines the start and the end of strings\n- `-i, --indentation \u003cSTRING\u003e` Defines how many tabs or spaces to insert inside a scope\n- `-o, --output \u003cFILE\u003e` Sets the output target file [default: index.d.ts]\n- `-t, --typescript_version \u003cSEMVER\u003e` Specify the typescript version to automatically disable incompatible features\n\n### Flags\n\n- `-V, --version` Prints version information\n- `-h, --help` Prints help information\n- `--sort` Enable sorting of interface keys\n- `--tree` Sets the formating strategy to tree\n\n### Strategies / Modes\n\n#### Tree\n\nFor this strategy we have nested typings following the same structure as the json, for example with the given json:\n\n```json\n{\n  \"glossary\": {\n    \"title\": \"example glossary\",\n    \"GlossDiv\": {\n      \"title\": \"S\",\n      \"GlossList\": {\n        \"GlossEntry\": {\n          \"ID\": \"SGML\",\n          \"SortAs\": \"SGML\",\n          \"GlossTerm\": \"Standard Generalized Markup Language\",\n          \"Acronym\": \"SGML\",\n          \"Abbrev\": \"ISO 8879:1986\",\n          \"GlossDef\": {\n            \"para\": \"A meta-markup language, used to create markup languages such as DocBook.\",\n            \"GlossSeeAlso\": [\"GML\", \"XML\"]\n          },\n          \"GlossSee\": \"markup\"\n        }\n      }\n    }\n  }\n}\n```\n\nAnd using the command:\n`jsontypings --tree data.json`\n\nWe generate the following typing in index.d.ts:\n\n```typescript\nexport interface All {\n    glossary: All.Glossary;\n}\n\nexport namespace All {\n    export interface Glossary {\n        title: string;\n        GlossDiv: Glossary.GlossDiv;\n    }\n\n    export namespace Glossary {\n        export interface GlossDiv {\n            GlossList: GlossDiv.GlossList;\n            title: string;\n        }\n\n        export namespace GlossDiv {\n            export interface GlossList {\n                GlossEntry: GlossList.GlossEntry;\n            }\n\n            export namespace GlossList {\n                export interface GlossEntry {\n                    SortAs: string;\n                    GlossSee: string;\n                    GlossDef: GlossEntry.GlossDef;\n                    Abbrev: string;\n                    Acronym: string;\n                    GlossTerm: string;\n                    ID: string;\n                }\n\n                export namespace GlossEntry {\n                    export interface GlossDef {\n                        GlossSeeAlso: string;\n                        para: string;\n                    }\n                }\n            }\n        }\n    }\n}\n```\n\n#### Cs50\n\nThis my final project for [cs50](https://cs50.harvard.edu/) and as per requested [this is my introduction video to this project](https://youtu.be/UquHbo7umzg).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayayem%2Fjson-typings","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fayayem%2Fjson-typings","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fayayem%2Fjson-typings/lists"}