{"id":14563826,"url":"https://github.com/Codex-/cosmiconfig-typescript-loader","last_synced_at":"2025-09-04T06:33:53.928Z","repository":{"id":38097828,"uuid":"430496690","full_name":"Codex-/cosmiconfig-typescript-loader","owner":"Codex-","description":"TypeScript config file handler for cosmiconfig","archived":false,"fork":false,"pushed_at":"2024-09-02T19:39:55.000Z","size":1725,"stargazers_count":29,"open_issues_count":3,"forks_count":7,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-09-06T10:31:40.133Z","etag":null,"topics":["cosmiconfig","cosmiconfig-loader","typescript"],"latest_commit_sha":null,"homepage":"","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/Codex-.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"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-11-21T22:34:38.000Z","updated_at":"2024-08-31T16:05:11.000Z","dependencies_parsed_at":"2023-02-19T11:31:05.818Z","dependency_job_id":"5fb38350-e8a2-4997-8eb5-f350aecca7ab","html_url":"https://github.com/Codex-/cosmiconfig-typescript-loader","commit_stats":{"total_commits":181,"total_committers":5,"mean_commits":36.2,"dds":0.3591160220994475,"last_synced_commit":"33caf726287c2477b57e51d1a3f9fc60d8245b66"},"previous_names":[],"tags_count":32,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fcosmiconfig-typescript-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fcosmiconfig-typescript-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fcosmiconfig-typescript-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Codex-%2Fcosmiconfig-typescript-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Codex-","download_url":"https://codeload.github.com/Codex-/cosmiconfig-typescript-loader/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":217902585,"owners_count":16248444,"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":["cosmiconfig","cosmiconfig-loader","typescript"],"created_at":"2024-09-07T02:05:41.573Z","updated_at":"2024-12-31T03:31:56.913Z","avatar_url":"https://github.com/Codex-.png","language":"TypeScript","funding_links":[],"categories":["typescript"],"sub_categories":[],"readme":"# cosmiconfig-typescript-loader\n\n\u003e ⚙️🚀 TypeScript config file support for cosmiconfig\n\n[![build](https://github.com/Codex-/cosmiconfig-typescript-loader/actions/workflows/build.yml/badge.svg)](https://github.com/Codex-/cosmiconfig-typescript-loader/actions/workflows/build.yml)\n[![codecov](https://codecov.io/gh/Codex-/cosmiconfig-typescript-loader/branch/main/graph/badge.svg?token=WWGNIPC249)](https://codecov.io/gh/Codex-/cosmiconfig-typescript-loader)\n[![npm](https://img.shields.io/npm/v/cosmiconfig-typescript-loader.svg)](https://www.npmjs.com/package/cosmiconfig-typescript-loader)\n\n## Usage\n\nSimply add `TypeScriptLoader` to the list of loaders for the `.ts` file type, and `await` loading:\n\n```ts\nimport { cosmiconfig } from \"cosmiconfig\";\nimport { TypeScriptLoader } from \"cosmiconfig-typescript-loader\";\n\nconst moduleName = \"module\";\nconst explorer = cosmiconfig(\"test\", {\n  searchPlaces: [\n    \"package.json\",\n    `.${moduleName}rc`,\n    `.${moduleName}rc.json`,\n    `.${moduleName}rc.yaml`,\n    `.${moduleName}rc.yml`,\n    `.${moduleName}rc.js`,\n    `.${moduleName}rc.ts`,\n    `.${moduleName}rc.cjs`,\n    `${moduleName}.config.js`,\n    `${moduleName}.config.ts`,\n    `${moduleName}.config.cjs`,\n  ],\n  loaders: {\n    \".ts\": TypeScriptLoader(),\n  },\n});\n\nconst cfg = await explorer.load(\"./\");\n```\n\nOr more simply if you only support loading of a TypeScript based configuration file:\n\n```ts\nimport { cosmiconfig } from \"cosmiconfig\";\nimport { TypeScriptLoader } from \"cosmiconfig-typescript-loader\";\n\nconst moduleName = \"module\";\nconst explorer = cosmiconfig(\"test\", {\n  loaders: {\n    \".ts\": TypeScriptLoader(),\n  },\n});\n\nconst cfg = await explorer.load(\"./amazing.config.ts\");\n```\n\n### Synchronously loading\n\nWith the release of Jiti 2, the synchronous loader has now been deprecated. It can still be used by using the `TypeScriptLoaderSync` export:\n\n```ts\nimport { cosmiconfig } from \"cosmiconfig\";\nimport { TypeScriptLoaderSync } from \"cosmiconfig-typescript-loader\";\n\nconst moduleName = \"module\";\nconst explorer = cosmiconfig(\"test\", {\n  loaders: {\n    \".ts\": TypeScriptLoaderSync(),\n  },\n});\n\nconst cfg = explorer.load(\"./amazing.config.ts\");\n```\n\n## `@endemolshinegroup/cosmiconfig-typescript-loader`\n\nThis package serves as a drop in replacement for `@endemolshinegroup/cosmiconfig-typescript-loader`. At the time of publishing this, `endemolshinegroup` is not maintaining the original package. I can only assume this is to do with the fact that Endemol Shine Group [was purchased and absorbed by another business](https://en.wikipedia.org/wiki/Endemol_Shine_Group#Sale_to_Banijay). This discontinuation of development efforts towards the original package left any open issues and pull requests unresolved.\n\nThis new package resolves the following original issues:\n\n- [`#134`](https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/issues/134): \"Doesn't work with Cosmiconfig sync API\"\n- [`#147`](https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/issues/147): \"doesn't provide typescript, requested by ts-node\"\n- [`#155`](https://github.com/EndemolShineGroup/cosmiconfig-typescript-loader/issues/155): \"Misleading TypeScriptCompileError when user's tsconfig.json \"module\" is set to \"es2015\"\"\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodex-%2Fcosmiconfig-typescript-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FCodex-%2Fcosmiconfig-typescript-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FCodex-%2Fcosmiconfig-typescript-loader/lists"}