{"_id":"@fluent/di","_rev":"28-64469b7996434b6ed529e00b19cb9f06","name":"@fluent/di","description":"Fluent - DI component","dist-tags":{"latest":"1.0.8"},"versions":{"1.0.1":{"name":"@fluent/di","version":"1.0.1","description":"Fluent - DI component","main":"build/index.js","typings":"build/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["fluent","di"],"license":"MIT","author":{"name":"Eugen Melnychenko"},"dependencies":{"reflect-metadata":"^0.1.12"},"devDependencies":{"@types/node":"^9.3.0","typescript":"^2.6.2"},"_id":"@fluent/di@1.0.1","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"},"dist":{"integrity":"sha512-35CrjQKDol2HW7XzDFI+aiE7R6uqBTeqlum2GxhHmhIAng12j+ZNdQcX6tertjG0WpFhFuCYtW6CRT5kd1ypfw==","shasum":"0f3a2f93ba11ff81215288e62ae6f9e523004ced","tarball":"https://registry.npmjs.org/@fluent/di/-/di-1.0.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIARQsSMKlk8uL5uNekRmFENMC+Jg5yG9BoBKS0OwCrk4AiAFwg1ilgJ4JHe0/hcUrmbdYATlBVDmFF9XHUB/UKpOJQ=="}]},"maintainers":[{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/di-1.0.1.tgz_1516626607152_0.22943490091711283"},"deprecated":"Not maintained anymore","directories":{}},"1.0.2":{"name":"@fluent/di","version":"1.0.2","description":"Fluent - DI component","main":"build/index.js","typings":"build/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["fluent","di"],"repository":{"type":"git","url":"git+https://github.com/emelnychenko/fluent.git"},"license":"MIT","author":{"name":"Eugen Melnychenko"},"dependencies":{"reflect-metadata":"^0.1.12"},"devDependencies":{"@types/node":"^9.3.0","typescript":"2.6.x"},"bugs":{"url":"https://github.com/emelnychenko/fluent/issues"},"homepage":"https://github.com/emelnychenko/fluent#readme","_id":"@fluent/di@1.0.2","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"},"dist":{"integrity":"sha512-roxkr4I+eBbWskITOgidV8kYtV0o3Yqcc/bSH3Tho0UnS/U2OJVorJHdS/o6euVD4GVT2swrzNlZ+ds3NaVKEQ==","shasum":"6a42e47ab1fc5213a9f6a66bb93b3406054e3fda","tarball":"https://registry.npmjs.org/@fluent/di/-/di-1.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIEeik9BXxj94Y1O/4KX2q+ERGaadWFrcx3de9KaE32rSAiEAxPw/JYYvbh4sVV6X04EOiLjOSfr5ZnuZUwI1aa3vCHE="}]},"maintainers":[{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/di-1.0.2.tgz_1516825256204_0.48982459120452404"},"deprecated":"Not maintained anymore","directories":{}},"1.0.5":{"name":"@fluent/di","version":"1.0.5","description":"Fluent - DI component","main":"build/index.js","typings":"build/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["fluent","di"],"repository":{"type":"git","url":"git+https://github.com/emelnychenko/fluent.git"},"license":"MIT","author":{"name":"Eugen Melnychenko"},"dependencies":{"reflect-metadata":"^0.1.12"},"devDependencies":{"@types/node":"^9.3.0","typescript":"2.6.x"},"bugs":{"url":"https://github.com/emelnychenko/fluent/issues"},"homepage":"https://github.com/emelnychenko/fluent#readme","_id":"@fluent/di@1.0.5","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"},"dist":{"integrity":"sha512-jVDCS8vFe1I6nAlIQbQYNsg6HgIaEqIhpWGddnTAmUGJ+kLK2krZ3QeoWOa14pqUIZA4SNYE/eJ9lqawoiDe0w==","shasum":"69b71f92df9b55ecd76cb2810ce3a40ddb16d19a","tarball":"https://registry.npmjs.org/@fluent/di/-/di-1.0.5.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCu3pc0vCpT2H19Tm2YBt9UMGfebusqZxRtFbNE7bSECwIgLwSMaJr5ffM9O0p/5jYxjh4n9kJxh/2GGUjucdKA6Ic="}]},"maintainers":[{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/di-1.0.5.tgz_1516971643105_0.8048710518050939"},"deprecated":"Not maintained anymore","directories":{}},"1.0.8":{"name":"@fluent/di","version":"1.0.8","description":"Fluent - DI component","main":"build/index.js","typings":"types/index.d.ts","scripts":{"build":"tsc","prepublishOnly":"npm run build"},"keywords":["fluent","di"],"repository":{"type":"git","url":"git+https://github.com/emelnychenko/fluent.git"},"license":"MIT","author":{"name":"Eugen Melnychenko"},"dependencies":{"reflect-metadata":"0.1.*"},"peerDependencies":{"@fluent/reflect":"1.0.8"},"devDependencies":{"@types/node":"^9.3.0","typescript":"2.6.*","@types/chai":"^4.1.2","chai":"^4.1.2","@types/mocha":"^2.2.47","mocha":"^5.0.0"},"bugs":{"url":"https://github.com/emelnychenko/fluent/issues"},"homepage":"https://github.com/emelnychenko/fluent#readme","_id":"@fluent/di@1.0.8","_npmVersion":"5.6.0","_nodeVersion":"8.9.0","_npmUser":{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"},"dist":{"integrity":"sha512-JJryoXR3/wYm5d9FNtIzQ1fvuw1HSBBSNOwUasgdhcSQ/3iYPGOiSYsP5HzMv48pO1ra7RiU5obB2POq1puYcg==","shasum":"ce61c506c85a8f6637ae5b53b5e0705290554c9e","tarball":"https://registry.npmjs.org/@fluent/di/-/di-1.0.8.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQC9sZIDJGH99AXxYjn3dgNqlriTlItXEtmWKY42G7DzEAIgCyv0u5AaP3AWeEiLkYBhJJ1U7F9xyJOTkUWiMXZstTY="}]},"maintainers":[{"name":"emelnychenko","email":"eugen.melnychenko@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/di-1.0.8.tgz_1517699079261_0.4543314299080521"},"directories":{},"deprecated":"Not maintained anymore"}},"readme":"# Dependency injection\n\nFluent use `reflect-metadata` for reflection and you need two conditions for proper functioning:\n\n+ you must add `\"experimentalDecorators\": true` to your tsconfig.json file\n+ you must add `\"emitDecoratorMetadata\": true` to your tsconfig.json file\n\nThis component has an identical implementation approach as `ASP.NET Core` and has a number of inconveniences.\n\nThe reflection can not be realized without decorators and therefore it is necessary to use the `@Injectable()` decorator for all classes to use dependency injection.\n\nExample of usage:\n\n```\n@Injectable()\nexport class PingService {\n}\n```\n\nThis decorator only emit metadata and does not process anything.\n\nThe service collection is carried out with the help of the `ServiceCollection` class and it has three main methods that add the right lifetime: \n\n+ `addSingleton()` - an instance of a service is always the same\n+ `addScope()` - an instance of a service is always the same if its call occurs in one scope\n+ `addTransient()` - the service instance is always unique\n\nExample of usage:\n\n```\n@Main()\nexport class Startup {\n  configureServices(services: ServiceCollection) {\n    services.addSingleton(PingService);\n  }\n}\n```\nYou can also get an instance of the service in the constructor:\n\n```\n@Injectable()\nexport class PongService {\n  constructor(pingService: PingService) {\n  }\n}\n```\n\nWhen calling `PongService` the instance will receive `PingService` as constructor argument.\n\n","maintainers":[{"email":"eemeli@gmail.com","name":"eemeli"},{"email":"zibi@braniecki.net","name":"zbraniecki"},{"email":"tatum.creative@gmail.com","name":"tatumcreative"},{"email":"flod@mozilla.com","name":"flod"}],"time":{"modified":"2022-04-05T11:25:10.018Z","created":"2018-01-22T12:24:51.104Z","1.0.0":"2018-01-22T12:24:51.104Z","1.0.1":"2018-01-22T13:10:08.030Z","1.0.2":"2018-01-24T20:20:57.257Z","1.0.4":"2018-01-26T12:56:49.071Z","1.0.5":"2018-01-26T13:00:44.159Z","1.0.6":"2018-02-03T20:12:18.608Z","1.0.7":"2018-02-03T20:26:01.248Z","1.0.8":"2018-02-03T23:04:40.193Z"},"keywords":["fluent","di"],"author":{"name":"Eugen Melnychenko"},"license":"MIT","readmeFilename":"README.md","homepage":"https://github.com/emelnychenko/fluent#readme","repository":{"type":"git","url":"git+https://github.com/emelnychenko/fluent.git"},"bugs":{"url":"https://github.com/emelnychenko/fluent/issues"}}