{"id":37227029,"url":"https://github.com/git-illuma/core","last_synced_at":"2026-04-09T14:02:39.542Z","repository":{"id":325679880,"uuid":"1102029058","full_name":"git-illuma/core","owner":"git-illuma","description":"A lightweight, type-safe dependency injection container for anything, inspired by Angular's DI system","archived":false,"fork":false,"pushed_at":"2026-01-14T05:53:31.000Z","size":391,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-14T09:23:32.656Z","etag":null,"topics":["angular","containers","dependency-injection","di","electron","inverse-of-control","nodejs"],"latest_commit_sha":null,"homepage":"","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/git-illuma.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-11-22T17:28:29.000Z","updated_at":"2026-01-14T05:53:35.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/git-illuma/core","commit_stats":null,"previous_names":["git-zodyac/illuma","git-illuma/core"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/git-illuma/core","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-illuma%2Fcore","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-illuma%2Fcore/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-illuma%2Fcore/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-illuma%2Fcore/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/git-illuma","download_url":"https://codeload.github.com/git-illuma/core/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/git-illuma%2Fcore/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442261,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"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":["angular","containers","dependency-injection","di","electron","inverse-of-control","nodejs"],"created_at":"2026-01-15T03:18:05.648Z","updated_at":"2026-04-02T17:56:53.204Z","avatar_url":"https://github.com/git-illuma.png","language":"TypeScript","readme":"# **Illuma** – Dependency Injection for TypeScript\n\n![NPM Version](https://img.shields.io/npm/v/%40illuma%2Fcore)\n![NPM Downloads](https://img.shields.io/npm/dw/%40illuma%2Fcore)\n![npm bundle size](https://img.shields.io/bundlephobia/min/%40illuma%2Fcore)\n![Test coverage](./badges/coverage.svg)\n\nA universal, lightweight and type-safe dependency injection container for TypeScript.\nHeavily inspired by Angular's DI system, but designed to work in any environment (Node.js, Bun, Deno, browsers, and more).\n\n## Features\n\n- **Type-Safe** – Excellent type inference\n- **Lightweight** – Zero dependencies, minimal bundle size\n- **Flexible** – Classes, factories, values, and aliases\n- **Optional decorators** – Injectable classes with `@NodeInjectable()` decorator\n- **Multi-Tokens** – Built-in multi-provider support\n- **Plugin System** – Extensible architecture with custom middlewares, scanners, and diagnostics\n- **TestKit** – Unit testing and mocking utilities for any testing framework\n- **Universal** – Node.js, Bun, Deno, browser, and Electron\n\n## V2 is out now!\n\nPlease check out the [migration guide](./docs/MIGRATION.md) for details on what's new and how to upgrade from v1. \n\n## Installation\n\n```bash\nnpm install @illuma/core\n```\n\n## Compatibility\n\nCompatible with virtually anything supporting ES2015+ (ES6+).\nPractically the library is compatible with Node.js (v14+), Bun, Deno and all modern browsers.\nFor older environments, consider using a transpiler or provide polyfills as needed.\n\n## Quick start\n\n```typescript\nimport { NodeContainer, NodeInjectable, nodeInject } from '@illuma/core';\n\n@NodeInjectable()\nclass Logger {\n  public log(message: string) {\n    console.log(`[LOG]: ${message}`);\n  }\n}\n\n@NodeInjectable()\nclass UserService {\n  private readonly logger = nodeInject(Logger);\n\n  public getUser(id: string) {\n    this.logger.log(`Fetching user ${id}`);\n    return { id, name: 'John Doe' };\n  }\n}\n\nconst container = new NodeContainer();\ncontainer.provide([Logger, UserService]);\ncontainer.bootstrap();\n\nconst userService = container.get(UserService);\n```\n\n\u003e **Note:** \n\u003e Example above requires `experimentalDecorators` and `emitDecoratorMetadata` in tsconfig. \n\u003e See [Getting Started](./docs/GETTING_STARTED.md) for decorator-free alternatives.\n\n## Using Tokens\n\n```typescript\nimport { NodeToken, MultiNodeToken, NodeContainer } from '@illuma/core';\n\n// Single-value token\nconst CONFIG = new NodeToken\u003c{ apiUrl: string }\u003e('CONFIG');\n\n// Multi-value token (when injected, returns array)\nconst PLUGINS = new MultiNodeToken\u003cPlugin\u003e('PLUGINS');\n\nconst container = new NodeContainer();\n\ncontainer.provide([\n  // Equivalent to:\n  // { provide: CONFIG, value: { apiUrl: 'https://api.example.com' } }\n  CONFIG.withValue({ apiUrl: 'https://api.example.com' }),\n\n  // Equivalent to:\n  // { provide: PLUGINS, useClass: AnalyticsPlugin }\n  PLUGINS.withClass(AnalyticsPlugin),\n\n  // Equivalent to:\n  // { provide: PLUGINS, useClass: LoggingPlugin }\n  PLUGINS.withClass(LoggingPlugin),\n]);\n\ncontainer.bootstrap();\n\nconst config = container.get(CONFIG);    // { apiUrl: string }\nconst plugins = container.get(PLUGINS);  // Plugin[]: [AnalyticsPlugin, LoggingPlugin]\n```\n\nSee [Tokens Guide](./docs/TOKENS.md) for more details.\n\n## Provider types\n\n```typescript\n// Class provider\ncontainer.provide(MyService);\n\n// Value provider\ncontainer.provide({ provide: CONFIG, value: { apiUrl: '...' } });\n\n// Factory provider\ncontainer.provide({ provide: DATABASE, factory: () =\u003e {\n  // You can use nodeInject inside factories!\n  const env = nodeInject(ENV);\n  return createDatabase(env.connectionString);\n} });\n\n// Class provider with custom implementation\ncontainer.provide({ provide: DATABASE, useClass: DatabaseImplementation });\n\n// Alias provider\ncontainer.provide({ provide: Database, alias: ExistingDatabase });\n```\n\nSee [Providers Guide](./docs/PROVIDERS.md) for details.\n\n## Testing\n\n```typescript\nimport { createTestFactory } from '@illuma/core/testkit';\n\nconst createTest = createTestFactory({\n  target: UserService,\n  provide: [{ provide: Logger, useClass: MockLogger }],\n});\n\nit('should fetch user', () =\u003e {\n  const { instance } = createTest();\n  expect(instance.getUser('123')).toBeDefined();\n});\n```\n\nSee [Testing Guide](./docs/TESTKIT.md) for examples.\n\n## Documentation\n\n| Guide                                              | Description                                           |\n| :--                                                | :--                                                   |\n| [Getting Started](./docs/GETTING_STARTED.md)       | Installation, setup, and basic usage                  |\n| [Providers](./docs/PROVIDERS.md)                   | Value, factory, class, and alias providers            |\n| [Tokens](./docs/TOKENS.md)                         | NodeToken and MultiNodeToken                          |\n| [Async Injection](./docs/ASYNC_INJECTION.md)       | Lazy loading and sub-containers                       |\n| [Testing](./docs/TESTKIT.md)                       | TestKit and mocking                                   |\n| [Plugins](./docs/PLUGINS.md)                       | Extending Illuma with custom scanners and diagnostics |\n| [Technical Overview](./docs/TECHNICAL_OVERVIEW.md) | Deep dive into how Illuma works                       |\n| [API Reference](./docs/API.md)                     | Complete API documentation                            |\n| [Troubleshooting](./docs/TROUBLESHOOTING.md)       | Error codes and solutions                             |\n\n## Plugins\n\nIlluma supports plugins! Check these out:\n\n- **[@illuma/reflect](https://github.com/git-illuma/reflect)** – Constructor metadata and property decorator injection support\n\nSee [Plugins Guide](./docs/PLUGINS.md) for creating your own plugins.\n\n## Contributing\n\nThank you for considering contributing to Illuma! I deeply appreciate your interest in making this project better.\n\nAnyways, to get you started, please take a look at the [Contributing Guide](./CONTRIBUTING.md) for guidelines on how to setup development environment, run tests, and submit pull requests.\n\n## License\n\nMIT\n\nCreated by [bebrasmell](https://github.com/bebrasmell)\n\n## Links\n- [NPM](https://npmjs.com/package/@illuma/core)\n- [GitHub](https://github.com/git-illuma/core)\n- [Issues](https://github.com/git-illuma/core/issues)\n","funding_links":[],"categories":["Angular-Inspired Solutions"],"sub_categories":["Wrappers"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-illuma%2Fcore","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgit-illuma%2Fcore","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgit-illuma%2Fcore/lists"}