{"_id":"@all-in-js/injector","_rev":"4-0cc8587600fe56b44d511467ce9cb561","name":"@all-in-js/injector","dist-tags":{"latest":"1.0.3"},"versions":{"1.0.0":{"name":"@all-in-js/injector","version":"1.0.0","description":"a Javascript & Nodejs dependencies injector","main":"dist","repository":{"type":"git","url":"git+https://github.com/all-in-js/dependencies-injector.git"},"author":{"name":"famanoder"},"license":"MIT","typings":"./index.d.ts","scripts":{"compile":"tsc && babel src/__test__ --out-dir dist/__test__ --delete-dir-on-start","dev":"yarn compile -w","prepublishOnly":"yarn compile && yarn test","test:dev":"jest --coverage","test":"jest --coverage --coverageReporters=text-lcov | coveralls"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-proposal-decorators":"^7.4.4","@babel/preset-env":"^7.4.5","@types/lodash.flatten":"^4.4.6","coveralls":"^3.0.9","jest":"^25.1.0","typescript":"^4.0.2"},"dependencies":{"@all-in-js/utils":"^1.0.0","lodash.flatten":"^4.4.0"},"keywords":["js","node.js","di","inject","injection","dependencies injector"],"jest":{"roots":["dist/__test__"],"notify":true},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}]],"plugins":[["@babel/plugin-proposal-decorators",{"legacy":true}],["@babel/plugin-proposal-class-properties",{"loose":true}]]},"gitHead":"8d85eaad7c768d8cc019c6f18c5c094de211f404","bugs":{"url":"https://github.com/all-in-js/dependencies-injector/issues"},"homepage":"https://github.com/all-in-js/dependencies-injector#readme","_id":"@all-in-js/injector@1.0.0","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-+RjvagfFfalTnmNVqR3ZH5CbGIwoXncTTkQu/BvaMzJgx7r5pR7km5IGKiTlac1GBcGDhFvzXgJsPGTSjEMT3Q==","shasum":"9039eba54985fa8db8f9847b7c605ccafeb6f682","tarball":"https://registry.npmjs.org/@all-in-js/injector/-/injector-1.0.0.tgz","fileCount":14,"unpackedSize":28577,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNjTwCRA9TVsSAnZWagAA8d0P/iEJyBqQp4EELBVjHXPQ\n4aamfW0axxJYNUnCFENLtwXlw/GuZnJAX9Ud4DChO8RZ9R3RhsR8jIXJxROu\n6H7+W0JDKzij8rfK3v1ls5jo9KrdShvKcxa3Tdnc3RZrdK+8mN6tVuZCZOtS\nLhWU6hl/mWQoXLNW/PhGyuRyxaODOkhtQ4hjKLYYlQXs431RGnVYWAgo8+4m\n42tZBjUfPfUgzP1Ledq5NMzyHiG2Lma5CQijcbocTr+C+rEpQ7r1eYZQf3g/\nep0oL/vmd/QVl1TWs1jC716oGnwvtho3+TJzDOgAnkwuXthsmoXoZDPMnT+6\ndwgTRT8ExgidRUhxC0OEQmXJmJ22P8UGnLZx1AsAsB6msHBmVxNblaAQGVvS\npNY3FW4WYl40A8o5YrDVaCmbeQuUIImkEwTqAA9pd2GPiBBaQIfo/7am9NE/\nsRUXGslN7zP7zac/mXPQTs9QXhdpE0glel/ukphIMzdVLc3G6RG7isoSVD/g\nYMAGIPuljKkhScjobY43vSWc8ybH1fUd57BP1UudvrjQvwDwFgWRSTk69Qxp\nr3Dp/SH6QHNeQBgZEtN9+GvR8I4Hm9C6MAzIdI94cTaZ4l+yoh9pmU+trpaA\neNCusLKlHYiEhxAvh3PwFzMiTVknfzx82xcZOBLuvirdmffdwTOgoM9CXsID\ndfw6\r\n=aJgL\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCWJ1PO6nhDf2UqxM3IBNajKkdzd2EWaPPSPthgnaP8fgIgUUDLMBtiqmxTgBqKBBD6hcE5KrAjQVQm03UpQ9QdFFQ="}]},"_npmUser":{"name":"eryue","email":"915905174@qq.com"},"directories":{},"maintainers":[{"name":"eryue","email":"915905174@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/injector_1.0.0_1614165231746_0.3692014494714151"},"_hasShrinkwrap":false},"1.0.1":{"name":"@all-in-js/injector","version":"1.0.1","description":"a Javascript & Nodejs dependencies injector","main":"dist","repository":{"type":"git","url":"git+https://github.com/all-in-js/dependencies-injector.git"},"author":{"name":"famanoder"},"license":"MIT","typings":"./index.d.ts","scripts":{"compile":"tsc && babel src/__test__ --out-dir dist/__test__ --delete-dir-on-start","dev":"yarn compile -w","prepublishOnly":"yarn compile","test:dev":"jest --coverage","test":"jest --coverage --coverageReporters=text-lcov | coveralls"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-proposal-decorators":"^7.4.4","@babel/preset-env":"^7.4.5","@types/lodash.flatten":"^4.4.6","coveralls":"^3.0.9","jest":"^25.1.0","typescript":"^4.0.2"},"dependencies":{"@all-in-js/utils":"^1.0.0","lodash.flatten":"^4.4.0"},"keywords":["js","node.js","di","inject","injection","dependencies injector"],"jest":{"roots":["dist/__test__"],"notify":true},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}]],"plugins":[["@babel/plugin-proposal-decorators",{"legacy":true}],["@babel/plugin-proposal-class-properties",{"loose":true}]]},"gitHead":"8d85eaad7c768d8cc019c6f18c5c094de211f404","bugs":{"url":"https://github.com/all-in-js/dependencies-injector/issues"},"homepage":"https://github.com/all-in-js/dependencies-injector#readme","_id":"@all-in-js/injector@1.0.1","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-VKFnHzIamKEvNj7/xhtb0HULOHnpS4Uy7G9IYE4HGCAWWTA4fLxRwcF3d/vAReqrhaaFrje80DM4ub8VeG0xHQ==","shasum":"51d5c5e61ae22c7835495cd55a71c73cd01182fd","tarball":"https://registry.npmjs.org/@all-in-js/injector/-/injector-1.0.1.tgz","fileCount":16,"unpackedSize":30661,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNjhxCRA9TVsSAnZWagAADhcQAJ7U/PlTwouamrlw5b/O\n9AS/iocEzvjqqLA7Lk7jqOGXLrPxi5usGhNbiqWLZE50Xw7ZE3bz+CVykjvw\nXL/9yYUz6uZIhlu+JDqh+AI68FroAH1lug/TOfCpEUy4tNmBegQQLvUOt2mD\ncN8RYNA83o0LhvvOVOIelLrcVnuz8t0cqfok6Ln+G8xIwzhfht7eDZ9w/9PE\nMKgFQ9REnpVX/E9LpMMA9g/F9nIdaYQOj9vfjm5xjhhi+k/aZkVGEFgxJjtD\neGLs466USJ6Mn4zWbcF9sldNWXnB3q3hdLt2rkAlClFTQyeKxbjtab4uOB8J\nca113DrMMlZ+60RpCmXZIX8oe/hJ9yt7b/Ozv/LqhqMxp74t+qXZ4yaJD26o\nwAToGaSBgzEQ8v5p+9odJpLj+/f9vs3/VCFdeBZ9AmXTjmYumHQu44YPNoHO\nHyWFkO7UO0darEeQ4rDOQFdDD1BlagFy4NliXcaLhWixE/v3ucqiGR1peNVY\ngduipuuD39RbVIPCfsbCkE70+mbhxjuBua7yxk/7PR4LW/HPNjIEedHi93k3\ndgzspIpWvNaDCxgynhwt9Qyw6am1qo9kAFjNWR0n1C6Gf0O0rSXBdpAJfK37\n+yhMcY9yZtqL3LYJdCxPiFtcLv1k0FDnrn6W5A5Inr7kKFGgKYjqnl36Ybf7\nUeFy\r\n=uYu7\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIEAbhKN4xybM0SDwzJ42fFUzWYAHnpaPhTYLv8qmbXQ/AiAnHjamyixyf/xBHbgf1MKeu7cHORTN7Z/nH2FW2MIVBg=="}]},"_npmUser":{"name":"eryue","email":"915905174@qq.com"},"directories":{},"maintainers":[{"name":"eryue","email":"915905174@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/injector_1.0.1_1614166128915_0.5768719825815467"},"_hasShrinkwrap":false},"1.0.2":{"name":"@all-in-js/injector","version":"1.0.2","description":"a Javascript & Nodejs dependencies injector","main":"dist","repository":{"type":"git","url":"git+https://github.com/all-in-js/dependencies-injector.git"},"author":{"name":"famanoder"},"license":"MIT","scripts":{"compile":"tsc && babel src/__test__ --out-dir dist/__test__ --delete-dir-on-start","dev":"yarn compile -w","prepublishOnly":"yarn compile","test:dev":"jest --coverage","test":"jest --coverage --coverageReporters=text-lcov | coveralls"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-proposal-decorators":"^7.4.4","@babel/preset-env":"^7.4.5","@types/lodash.flatten":"^4.4.6","coveralls":"^3.0.9","jest":"^25.1.0","typescript":"^4.0.2"},"dependencies":{"@all-in-js/utils":"^1.0.0","lodash.flatten":"^4.4.0"},"keywords":["js","node.js","di","inject","injection","dependencies injector"],"jest":{"roots":["dist/__test__"],"notify":true},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}]],"plugins":[["@babel/plugin-proposal-decorators",{"legacy":true}],["@babel/plugin-proposal-class-properties",{"loose":true}]]},"gitHead":"8d85eaad7c768d8cc019c6f18c5c094de211f404","bugs":{"url":"https://github.com/all-in-js/dependencies-injector/issues"},"homepage":"https://github.com/all-in-js/dependencies-injector#readme","_id":"@all-in-js/injector@1.0.2","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-5HsOVkFe5qZGmBlhN93m+DNf2Vp/xu4k86XVeZemWn3XoF/UtvjovjEHeQXBh59PHm4qpKS2IudxVBRU8Hv/sA==","shasum":"c1323f0fcd856c146a3249cdc6898bdddeaf07ca","tarball":"https://registry.npmjs.org/@all-in-js/injector/-/injector-1.0.2.tgz","fileCount":16,"unpackedSize":30632,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNjl7CRA9TVsSAnZWagAAM9UP/2nkZ+lloPu6vrklyxn6\nOJFC+vqN3Pq78qGqJtBtj0IAUTXv/GxS7TDfd8Z8ooqh7h7p0bPENpzFC1PS\nhqSVH58F/IPvZDqjp6v1csr2LA34dF+ipBX6ADGbOFKxkcsqZDVlGH66u4DM\nNPfFwbU5y0eX1hldx/Ad+gA0PzMczJhgkWDNfpmVob0zFbAVKvOMcgi1xM5I\nBlEO/eRe/a66ttAX4S4KH7ob1frWTikdrX2lJQlx/QFWh9H8FyqVMAyeJFJD\nJ+DD3BwdYLLumgqBOJverUEHn76Lu9RODDMzIEiCfvlDimzbL+BhJXvB0G/B\n4rvy85lFs8FWmnb0tIp9cOuZ5x0l7eZvUWAAA82KAUHn276wAaa2ZQJmpL/u\nAMGrtYuYbz4IeiIR1O4yCcPaPpi84j5ZvGchYx9yxjN1aKf7TGly2zvIHxNt\nzF/i+MKdpRUyDAObm4pM9pnUgM2TfG7GWH60DslVdokGxY/wP48RxPnbcdxz\nN1JTB2L6amLKijbu+EcyJBVpA6k2mqGMBvpOXWRz37u2HAgmifcaMuBJXkNP\nIqp1TaewAszvWwpx6rsT5OK7kKzY8Pg2FmJNYMlf9u5tyEVQlxNlTweMV8dQ\npZ8O8AYOsZAqGv3PBeioLavm+aGByQ7bkSGE4OASttqUi0ugKM3CF79tHu+Z\nNQvC\r\n=lQuQ\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQDdqaJNtP//VKsK7LunO6yHLaSNp9JdkDjSqu+GPxxZxQIgGg5G8Z1UmZJQ7d+4v5Z/dzmgJ+zk93ILWf+atwhnvN0="}]},"_npmUser":{"name":"eryue","email":"915905174@qq.com"},"directories":{},"maintainers":[{"name":"eryue","email":"915905174@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/injector_1.0.2_1614166394681_0.8165981289225996"},"_hasShrinkwrap":false},"1.0.3":{"name":"@all-in-js/injector","version":"1.0.3","description":"a Javascript & Nodejs dependencies injector","main":"dist","repository":{"type":"git","url":"git+https://github.com/all-in-js/dependencies-injector.git"},"author":{"name":"famanoder"},"license":"MIT","scripts":{"compile":"tsc && babel src/__test__ --out-dir dist/__test__ --delete-dir-on-start","dev":"yarn compile -w","prepublishOnly":"yarn compile","test:dev":"jest --coverage","test":"jest --coverage --coverageReporters=text-lcov | coveralls"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"devDependencies":{"@babel/cli":"^7.4.4","@babel/core":"^7.4.5","@babel/plugin-proposal-class-properties":"^7.4.4","@babel/plugin-proposal-decorators":"^7.4.4","@babel/preset-env":"^7.4.5","@types/lodash.flatten":"^4.4.6","coveralls":"^3.0.9","jest":"^25.1.0","typescript":"^4.0.2"},"dependencies":{"@all-in-js/utils":"^1.0.0","lodash.flatten":"^4.4.0"},"keywords":["js","node.js","di","inject","injection","dependencies injector"],"jest":{"roots":["dist/__test__"],"notify":true},"babel":{"presets":[["@babel/preset-env",{"targets":{"node":"current"}}]],"plugins":[["@babel/plugin-proposal-decorators",{"legacy":true}],["@babel/plugin-proposal-class-properties",{"loose":true}]]},"gitHead":"8d85eaad7c768d8cc019c6f18c5c094de211f404","bugs":{"url":"https://github.com/all-in-js/dependencies-injector/issues"},"homepage":"https://github.com/all-in-js/dependencies-injector#readme","_id":"@all-in-js/injector@1.0.3","_nodeVersion":"12.18.4","_npmVersion":"6.14.6","dist":{"integrity":"sha512-BA7zbkExJOyWQn+qe8vZN6FiwKhWvHdDGLIunzYYXqvRwdscn1NWlSH/ZpfEjN+sev1YQ+OtT/YfB1Ud2TPcbQ==","shasum":"68aa949d3e5e29ae901416f7264ae91c7da459d6","tarball":"https://registry.npmjs.org/@all-in-js/injector/-/injector-1.0.3.tgz","fileCount":16,"unpackedSize":30643,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJgNx1KCRA9TVsSAnZWagAACYwP+gPk0SeUfwjThiU1R3GK\nLeox7plD/bpyhnY/BLX12HtdA48A4VvzRDiEmbtfnWplSiJxKqhD+mNckS22\nG3xXxrCvw0oO+Tw0DrK8o6ARy8VpK8fhsuc2C4uzxPdEk+FT7oHsEjoKS65X\nUm3gM4S6zwFCsnAy6Knk+6H0g9Ct13xYZZmx2a1sY/F8J/C3kQyYnT3RwHSy\nA/FoCphKJPKg7GdsQdLeDZqyHah9IxICMta+Fuhdy4q/un/pUY4AfII0yQGu\nlQtYduDP0IDMfj1l/gnXEjmIXVGpUF+K1CgisUBYHsZQHOJ6Fm8FP1Kq/Pba\nic0fBp8HuieWRayuafPO+KLk/n/uIoyDICA5IjEkeJ7ikPX2psYxVL33GC/v\ntO9kVbX7B61b1FDP/Wy2nHjNlXmU25UT58dqPAVzdjju0HiS3ZWpehgTKvKH\nJq8nRtVFkmWx8LfqLgrYFdMKtwJooTdpEMpOTA87W6khMgFaRn8TlrP41WaE\nqF68siPrnQ2Fmr8jke04AP57jINszLPBOdolNpXqwqlxiy/ePFv+FuAQQ9RI\nvD5xoFvavr5hcpVKQOyGp3tMxq4oFO3TS/YIH95nEQqy8h+gU2+wXbKBys0T\nuE6GKCFG1fSYOGmnmY5doZaCCwy0vHhVXuw8fXQC2p86BqIMmSkX7p3T95VG\ntb1z\r\n=Q2nX\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAnl59wnB9ec7rDW08HKUVihxtTmRRRVEDDzB/UrDIpjAiEAybLSuuPcEgSxOx3qH93uyuiKg9hSX0fC03xcnDuW3l4="}]},"_npmUser":{"name":"eryue","email":"915905174@qq.com"},"directories":{},"maintainers":[{"name":"eryue","email":"915905174@qq.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/injector_1.0.3_1614224713328_0.5988745206902641"},"_hasShrinkwrap":false}},"time":{"created":"2021-02-24T11:13:51.487Z","1.0.0":"2021-02-24T11:13:51.909Z","modified":"2022-04-04T13:31:21.075Z","1.0.1":"2021-02-24T11:28:49.064Z","1.0.2":"2021-02-24T11:33:14.873Z","1.0.3":"2021-02-25T03:45:13.556Z"},"maintainers":[{"name":"eryue","email":"915905174@qq.com"}],"description":"a Javascript & Nodejs dependencies injector","homepage":"https://github.com/all-in-js/dependencies-injector#readme","keywords":["js","node.js","di","inject","injection","dependencies injector"],"repository":{"type":"git","url":"git+https://github.com/all-in-js/dependencies-injector.git"},"author":{"name":"famanoder"},"bugs":{"url":"https://github.com/all-in-js/dependencies-injector/issues"},"license":"MIT","readme":"<div class=\"__changelog--header__\">\n\n[![npm](https://img.shields.io/npm/v/@eryue/injector.svg?label=version)](https://www.npmjs.com/package/@eryue/injector) [![Build Status](https://travis-ci.org/famanoder/dependencies-injector.svg?branch=master)](https://travis-ci.org/famanoder/dependencies-injector) [![Coverage Status](https://coveralls.io/repos/github/famanoder/dependencies-injector/badge.svg?branch=master)](https://coveralls.io/github/famanoder/dependencies-injector?branch=master)\n\n> a Javascript & Nodejs dependencies injector\n\n</div>\n\n<div class=\"__changelog--body__\">\n  \n### Usage\n\n* **Container class**\n\n```js\nimport { ContainerClass } from '@all-in-js/injector';\n\nconst initDeps = {\n  key: function key() {}\n};\nconst container = new ContainerClass(initDeps);\n\ncontainer.add(class TestService{});\n\ncontainer.resolve(['TestService', 'key'], function(testService, key) {});\n// or\nconst [testService] = container.resolve('TestService');\n\n// this `container.resolve` support various types, eg:\n// `container.resolve(string[array<string>[function]])` \n// if argument just is a function, it's arguments would be parsed to be an array to be resolved.\n```\n\n* **Decorator**\n\n```js\nimport { Injectable } from '@all-in-js/injector';\n\n@Injectable\nclass TestService {}\n```\n\n* inject to constructor\n\n```js\nimport { Inject } from '@all-in-js/injector';\n\n@Inject('TestService')\nclass TestControler {\n  constructor(testService) {\n    this.testService = testService;\n  }\n}\n```\n\n* inject to class's function prop\n\n```js\nimport { Inject } from '@all-in-js/injector';\n\nclass TestControler {\n  @Inject('TestService')\n  test(testService) {\n    // ...\n  }\n}\n```\n\n* inject to class's value prop\n\n```js\nimport { Inject } from '@all-in-js/injector';\n\nclass TestControler {\n  @Inject('TestService') testService;\n  toString() {\n    // this.testService\n  }\n}\n```\n\n* when inject to class's function prop, merge injected value and your arguments.\n\n```js\nimport { Inject } from '@all-in-js/injector';\n\nclass TestControler {\n  @Inject('TestService')\n  test(testService, yourArguments) {\n    // ...\n  }\n}\n\nnew TestControler().test('yourArguments');\n```\n\n</div>\n","readmeFilename":"README.md"}