{"id":15953775,"url":"https://github.com/yasu-s/ts-json-module-sample","last_synced_at":"2026-04-26T23:31:47.054Z","repository":{"id":149598436,"uuid":"225362882","full_name":"yasu-s/ts-json-module-sample","owner":"yasu-s","description":"TypeScript resolveJsonModule Sample","archived":false,"fork":false,"pushed_at":"2019-12-03T23:02:13.000Z","size":6,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-04T05:41:51.575Z","etag":null,"topics":["json","typescript"],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":false,"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/yasu-s.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-12-02T11:49:11.000Z","updated_at":"2019-12-03T23:02:15.000Z","dependencies_parsed_at":null,"dependency_job_id":"417ddbcd-67cd-425e-89af-25a51fa76961","html_url":"https://github.com/yasu-s/ts-json-module-sample","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/yasu-s/ts-json-module-sample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasu-s%2Fts-json-module-sample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasu-s%2Fts-json-module-sample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasu-s%2Fts-json-module-sample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasu-s%2Fts-json-module-sample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yasu-s","download_url":"https://codeload.github.com/yasu-s/ts-json-module-sample/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yasu-s%2Fts-json-module-sample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32317163,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"ssl_error","status_checked_at":"2026-04-26T23:26:25.802Z","response_time":129,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["json","typescript"],"created_at":"2024-10-07T13:14:02.343Z","updated_at":"2026-04-26T23:31:47.039Z","avatar_url":"https://github.com/yasu-s.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ts-json-module-sample\n\n## 概要\n\n* TypeScript で resolveJsonModule を使用したサンプルです。\n* tsconfig.json 上で resolveJsonModule を指定することでjsonファイルから型の抽出・生成を行うことができます。\n\n## 実行環境\n\n* Node.js - 10.x\n* Yarn - 1.17.x\n\n## 使用ライブラリ\n\n* TypeScript - 3.7.x\n\n## サンプルソース\n\n### tsconfig.json\n\n```json\n{\n  \"compilerOptions\": {\n    \"target\": \"esnext\",\n    \"module\": \"commonjs\",\n    \"sourceMap\": true,\n    \"outDir\": \"./dist\",\n    \"esModuleInterop\": true,\n    \"resolveJsonModule\": true\n  },\n  \"include\": [\n   \"src/**/*\"\n  ]\n}\n```\n\n### src/data.json\n\n```json\n{\n  \"id\": 1,\n  \"memo\": \"hogehoge\"\n}\n```\n\n### src/main.ts\n\n```typescript\nimport data from './data.json';\n\nconsole.log(`id=${data.id}, memo=${data.memo}`);\n```\n\n## 実行結果\n\n```bash\nyarn start\nid=1, memo=hogehoge\n```\n\n## URL\n\n* https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-9.html#new---resolvejsonmodule\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasu-s%2Fts-json-module-sample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyasu-s%2Fts-json-module-sample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyasu-s%2Fts-json-module-sample/lists"}