{"id":18951178,"url":"https://github.com/hmmhmmhm/typescript-json","last_synced_at":"2025-10-06T14:28:28.069Z","repository":{"id":51699405,"uuid":"214852930","full_name":"hmmhmmhm/typescript-json","owner":"hmmhmmhm","description":"📦 Initialize JSON data according to type schema","archived":false,"fork":false,"pushed_at":"2021-05-10T17:17:25.000Z","size":22,"stargazers_count":11,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-27T16:52:02.230Z","etag":null,"topics":["init","initialization","initializer","json","schema","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","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/hmmhmmhm.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":"2019-10-13T16:21:04.000Z","updated_at":"2022-04-15T00:11:20.000Z","dependencies_parsed_at":"2022-08-03T00:01:20.473Z","dependency_job_id":null,"html_url":"https://github.com/hmmhmmhm/typescript-json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/hmmhmmhm/typescript-json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmmhmmhm%2Ftypescript-json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmmhmmhm%2Ftypescript-json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmmhmmhm%2Ftypescript-json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmmhmmhm%2Ftypescript-json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hmmhmmhm","download_url":"https://codeload.github.com/hmmhmmhm/typescript-json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hmmhmmhm%2Ftypescript-json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274647908,"owners_count":25324293,"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-11T02:00:13.660Z","response_time":74,"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":["init","initialization","initializer","json","schema","typescript"],"created_at":"2024-11-08T13:26:47.097Z","updated_at":"2025-10-06T14:28:23.023Z","avatar_url":"https://github.com/hmmhmmhm.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Typescript JSON\n\n\u003e 📦 Initialize JSON data according to type schema\n\n\n\nHave you ever had trouble resetting the values you received to the desired form of value when you received any data from the web or server?\n\nThe \u003cu\u003e**Typescript JSON**\u003c/u\u003e module helps initialize the JSON data to the desired Schema. It also supports Intellisense and Automatic Completion based on Typescript. (This module is a module that binds [scotthovestadt/schema-object]( https://github.com/scotthovestadt/schema-object) to a Typescript.)\n\n\n\n## Install\n\n```bash\nnpm install typescript-json\n```\n\n\n\n## Usage\n\n```typescript\nimport {\n    TypescriptJSON,\n    Types\n} from 'typescript-json'\n\n// Defines the data schema.\nlet schema = {\n\n    // If non-compliant data is entered,\n    // the value will be replaced with undefined\n    id: Types.String({\n        default: 'accountId',\n        minLength: 6\n    }),\n\n    // Or just can simply specify a format.\n    pw: Types.String({})\n}\n\n// Contains the data to be entered.\nlet input: any = {}\n\n// Input value of modified\n// to schema specification\nlet data = TypescriptJSON\n    \u003ctypeof schema\u003e\n    (schema, input)\n\nconsole.log(data.id) // 'accountId'\nconsole.log(data.pw) // undefined\n\n\n// The value does not change because the\n// minimum length specification does not comply.\ndata.id = 'wrong' // need to be more than 6 length.\nconsole.log(data.id) // still 'accountId'\n```\n\n\n\n## Example\n\n![](https://i.imgur.com/IJ2TaSd.png)\n\nIt can define the default value of the id value, define the maximum length, and so on.\n\n\n\n![](https://i.imgur.com/OsdRJ6E.png)\n\n Once the data has been initialized, all components of the data can be accessed accurately through Intelligence and Auto Completion. \n\n\n\n## License\n\nMIT Licensed.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmmhmmhm%2Ftypescript-json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhmmhmmhm%2Ftypescript-json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhmmhmmhm%2Ftypescript-json/lists"}