{"id":21584963,"url":"https://github.com/snatalenko/di6","last_synced_at":"2025-03-18T09:13:15.858Z","repository":{"id":42958705,"uuid":"230245137","full_name":"snatalenko/di6","owner":"snatalenko","description":"Dependency injection for ES6 classes","archived":false,"fork":false,"pushed_at":"2023-01-06T02:22:50.000Z","size":946,"stargazers_count":1,"open_issues_count":10,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-24T15:28:03.891Z","etag":null,"topics":["dependency-injection","es6"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/snatalenko.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}},"created_at":"2019-12-26T10:31:39.000Z","updated_at":"2022-02-11T11:25:17.000Z","dependencies_parsed_at":"2023-02-05T02:46:13.934Z","dependency_job_id":null,"html_url":"https://github.com/snatalenko/di6","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snatalenko%2Fdi6","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snatalenko%2Fdi6/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snatalenko%2Fdi6/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/snatalenko%2Fdi6/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/snatalenko","download_url":"https://codeload.github.com/snatalenko/di6/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244189829,"owners_count":20412991,"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","es6"],"created_at":"2024-11-24T15:08:35.938Z","updated_at":"2025-03-18T09:13:15.835Z","avatar_url":"https://github.com/snatalenko.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DI Container \u0026 Builder\n\n## Getting Started\n\n```js\nclass Car {\n\t/**\n\t * Creates instance of Car,\n\t * expects 1 parameter object argument with dependencies\n\t * \n\t * @param {object} dependencies\n\t * @param {Engine} dependencies.engine\n\t */\n\tconstructor({ engine }) {\n\t\tthis._engine = engine;\n\t}\n}\n\nclass Engine { }\n```\n\n```js\nconst { ContainerBuilder } = require('di6');\n\nconst builder = new ContainerBuilder();\n\n// Give the `Engine` type an alias that will be used for dependency resolving\nbuilder.register(Engine)\n\t.as('engine')\n\t.asInstancePerDependency();\n\nconst container = builder.container();\n\nconst car = container.createInstance(Car); // instanceOf Car\ncar._engine; // instanceOf Engine\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnatalenko%2Fdi6","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsnatalenko%2Fdi6","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsnatalenko%2Fdi6/lists"}