{"id":15356771,"url":"https://github.com/yeppha/ts-di-transformer-example","last_synced_at":"2026-07-19T06:34:49.606Z","repository":{"id":71189331,"uuid":"164480661","full_name":"YePpHa/ts-di-transformer-example","owner":"YePpHa","description":"An example of the dependency injection with ts-di-transformer","archived":false,"fork":false,"pushed_at":"2019-01-07T19:35:46.000Z","size":54,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-10-21T20:39:28.336Z","etag":null,"topics":["dependency-injection","example","interface","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":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/YePpHa.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-01-07T19:22:56.000Z","updated_at":"2023-09-08T17:49:00.000Z","dependencies_parsed_at":null,"dependency_job_id":"655f9050-bc09-40fc-a8e0-8941533938a1","html_url":"https://github.com/YePpHa/ts-di-transformer-example","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/YePpHa/ts-di-transformer-example","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fts-di-transformer-example","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fts-di-transformer-example/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fts-di-transformer-example/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fts-di-transformer-example/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/YePpHa","download_url":"https://codeload.github.com/YePpHa/ts-di-transformer-example/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/YePpHa%2Fts-di-transformer-example/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35644212,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-19T02:00:06.923Z","response_time":112,"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":["dependency-injection","example","interface","typescript"],"created_at":"2024-10-01T12:29:53.814Z","updated_at":"2026-07-19T06:34:49.595Z","avatar_url":"https://github.com/YePpHa.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Example of Dependency Injection with Interfaces\nThis is an example app that test dependency injection with interfaces. It uses\nhttps://github.com/YePpHa/ts-di-transformer to demonstrate that it's possible\nwithout needing to use annotations.\n\n## How to start this program\n__Yarn__\n```\n$ yarn\n$ yarn start\n```\n\n__NPM__\n```\n$ npm install\n$ npm run start\n```\n\n## How does it work?\nThe project https://github.com/YePpHa/ts-di-transformer will transform the code\non compile-time. However, this requires the custom transformer to be used that's\nincluded in `ts-di-transformer`.\n\nThis example is directly calling the TypeScript API to apply the custom\ntransformer. However, if you're using webpack you can use\n[awesome-typescript-loader](https://github.com/s-panferov/awesome-typescript-loader#getcustomtransformers-string--program-tsprogram--tscustomtransformers--undefined-defaultundefined).\n\n### Bootstraping\n\nAll interfaces must be declared before starting the app. This can be done as in\n`/src/main.ts`:\n```TypeScript\n[...]\n\nconst bootstrap = new Container();\n\nbootstrap.bind(InterfaceSymbol\u003cIHttp\u003e(), Http);\nbootstrap.bind(InterfaceSymbol\u003cITodoService\u003e(), Todo);\n\nbootstrap.resolve(App).run();\n```\n\nNotice that each implementation of an interface must be declared before calling\n`.resolve(App)`. If they're not called it will result in an runtime error as the\ndependency system will not be able to find the implementation.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeppha%2Fts-di-transformer-example","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyeppha%2Fts-di-transformer-example","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyeppha%2Fts-di-transformer-example/lists"}