{"id":29172275,"url":"https://github.com/leonadler/lightweight-di","last_synced_at":"2025-09-07T07:02:29.011Z","repository":{"id":49209396,"uuid":"95048434","full_name":"leonadler/lightweight-di","owner":"leonadler","description":"Lightweight dependency injection for TypeScript and JavaScript","archived":false,"fork":false,"pushed_at":"2024-09-03T19:44:49.000Z","size":153,"stargazers_count":4,"open_issues_count":3,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-05-27T05:07:37.876Z","etag":null,"topics":["dependency-injection","dependency-tree","node","typescript-design-patterns","typescript-di","typescript-library"],"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/leonadler.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":"2017-06-21T21:38:07.000Z","updated_at":"2023-09-08T11:13:08.000Z","dependencies_parsed_at":"2023-01-20T09:11:18.144Z","dependency_job_id":null,"html_url":"https://github.com/leonadler/lightweight-di","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/leonadler/lightweight-di","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonadler%2Flightweight-di","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonadler%2Flightweight-di/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonadler%2Flightweight-di/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonadler%2Flightweight-di/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/leonadler","download_url":"https://codeload.github.com/leonadler/lightweight-di/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/leonadler%2Flightweight-di/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262969875,"owners_count":23392530,"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":["dependency-injection","dependency-tree","node","typescript-design-patterns","typescript-di","typescript-library"],"created_at":"2025-07-01T13:11:06.353Z","updated_at":"2025-07-01T13:11:29.302Z","avatar_url":"https://github.com/leonadler.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Lightweight Dependency Injection\n\n[![npm version](https://badge.fury.io/js/lightweight-di.svg)](https://badge.fury.io/js/lightweight-di)\n[![travis build status](https://travis-ci.org/leonadler/lightweight-di.svg)](https://travis-ci.org/leonadler/lightweight-di/)\n\nA dependency injection library for node and the browser, based on [Angulars DI](https://angular.io/guide/architecture#dependency-injection).\nOptimized for use via [TypeScript](https://github.com/Microsoft/TypeScript#readme) or [babel](https://github.com/babel/babel#readme) [decorators](https://babeljs.io/docs/plugins/transform-decorators/).\n\n\n## Getting started\n\n### 1. Install the library in your project\n\n```sh\nnpm install --save lightweight-di\n```\n\n### 2. Import the required decorators from the package\n\n```typescript\n// TypeScript / Babel / Webpack\nimport { Injectable } from 'lightweight-di';\n\n// Node.js / Browserify\nconst { Injectable } = require('lightweight-di');\n```\n\n### 3. Decorate classes with dependencies\n\n```typescript\n@Injectable\nclass FileLogger {\n    constructor(private fs: FileSystem) { }\n    log(message: string) {\n        fs.appendToFile('app.log', message);\n    }\n}\n```\n\n### 4. Bootstrap your application entry point with `Injector`\n\n```typescript\nimport { Injector } from 'lightweight-di';\nconst injector = Injector.resolveAndCreate([App, Dependency1, Dependency2]);\ninjector.get(App).run();\n```\n\n## Documentation \u0026 Examples\n\nFor the full API check out the [documentation](https://github.com/leonadler/lightweight-di/blob/master/docs/api.md)\nor the [examples](https://github.com/leonadler/lightweight-di/blob/master/docs/examples) on GitHub.\n\n\n## License\n\n[MIT](https://github.com/leonadler/lightweight-di/blob/master/LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonadler%2Flightweight-di","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fleonadler%2Flightweight-di","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fleonadler%2Flightweight-di/lists"}