{"_id":"@aedart/js-service-provider","_rev":"9-2348c399d9b5953bbc96347c2251063b","name":"@aedart/js-service-provider","description":"Service Provider where you can register your IoC bindings","dist-tags":{"latest":"1.2.1"},"versions":{"0.9.0":{"name":"@aedart/js-service-provider","version":"0.9.0","description":"EXPERIMENT","main":"index.js","scripts":{"test":"karma start karma.conf.js"},"repository":{"type":"git","url":"git+https://github.com/aedart/js-service-provider.git"},"keywords":["Service","Provider","IoC","Inversion of Control","Container"],"author":{"name":"Alin Eugen Deac","email":"aedart@gmail.com","url":"https://github.com/aedart"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/aedart/js-facade/issues"},"homepage":"https://github.com/aedart/js-facade#readme","dependencies":{"@aedart/js-facade":"^1.0.0","mixwith":"~0.1"},"devDependencies":{"@aedart/js-ioc":"^0.9.0","babel-plugin-external-helpers":"^6.18.0","babel-plugin-transform-builtin-extend":"^1.1.0","babel-preset-es2015-rollup":"^1.2.0","babel-preset-es2016":"^6.16.0","faker":"^3.1.0","jasmine":"^2.5.2","karma":"^1.3.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-ie-launcher":"^1.0.0","karma-jasmine":"^1.0.2","karma-phantomjs-launcher":"^1.0.2","karma-rollup-plugin":"^0.2.4","karma-spec-reporter":"0.0.26","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-plugin-buble":"^0.14.0","rollup-plugin-commonjs":"^5.0.5","rollup-plugin-eslint":"^3.0.0","rollup-plugin-node-builtins":"^2.0.0","rollup-plugin-node-globals":"^1.0.9","rollup-plugin-node-resolve":"^2.0.0","rollup-plugin-replace":"^1.1.1","rollup-plugin-uglify":"^1.0.1","uglify-js-harmony":"^2.6.2"},"gitHead":"90cae6d801257d50470870763c90cfa15c91eb82","_id":"@aedart/js-service-provider@0.9.0","_shasum":"9a3ac90b2b8f7af57ce828d0d578af0f8e646f73","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"aedart","email":"aedart@gmail.com"},"dist":{"shasum":"9a3ac90b2b8f7af57ce828d0d578af0f8e646f73","tarball":"https://registry.npmjs.org/@aedart/js-service-provider/-/js-service-provider-0.9.0.tgz","integrity":"sha512-T5r3qfC7RRBwCn+UN/6+TV+/qrtJPjyCQ9efca0LL4rmOv7n2jkw1j2CEqOZkzsfTbjXcpwCuqBlf38uux1eXA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIETb5fA01p/nGHndbNtfcZZ38fxltTaMp42Ml9ar4YzrAiAfHk6e+hy9FDOsI8BmcKTBaAP7iIDPTFuj8RmT0csLPg=="}]},"maintainers":[{"name":"aedart","email":"aedart@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/js-service-provider-0.9.0.tgz_1478438959987_0.7639166333246976"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.0.0":{"name":"@aedart/js-service-provider","version":"1.0.0","description":"Service Provider where you can register your IoC bindings","main":"index.js","scripts":{"test":"karma start karma.conf.js"},"repository":{"type":"git","url":"git+https://github.com/aedart/js-service-provider.git"},"keywords":["Service","Provider","IoC","Inversion of Control","Container"],"author":{"name":"Alin Eugen Deac","email":"aedart@gmail.com","url":"https://github.com/aedart"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/aedart/js-facade/issues"},"homepage":"https://github.com/aedart/js-facade#readme","dependencies":{"@aedart/js-facade":"^1.0.0","mixwith":"~0.1"},"devDependencies":{"@aedart/js-ioc":"^1.0.0","babel-plugin-external-helpers":"^6.18.0","babel-plugin-transform-builtin-extend":"^1.1.0","babel-preset-es2015-rollup":"^1.2.0","babel-preset-es2016":"^6.16.0","faker":"^3.1.0","jasmine":"^2.5.2","karma":"^1.3.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-ie-launcher":"^1.0.0","karma-jasmine":"^1.0.2","karma-phantomjs-launcher":"^1.0.2","karma-rollup-plugin":"^0.2.4","karma-spec-reporter":"0.0.26","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-plugin-buble":"^0.14.0","rollup-plugin-commonjs":"^5.0.5","rollup-plugin-eslint":"^3.0.0","rollup-plugin-node-builtins":"^2.0.0","rollup-plugin-node-globals":"^1.0.9","rollup-plugin-node-resolve":"^2.0.0","rollup-plugin-replace":"^1.1.1","rollup-plugin-uglify":"^1.0.1","uglify-js-harmony":"^2.6.2"},"gitHead":"e24dc83588d30176140f85e066430c993674079d","_id":"@aedart/js-service-provider@1.0.0","_shasum":"51b0b15fcc76f80e9face987f1f2b4943e9b2f87","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"aedart","email":"aedart@gmail.com"},"dist":{"shasum":"51b0b15fcc76f80e9face987f1f2b4943e9b2f87","tarball":"https://registry.npmjs.org/@aedart/js-service-provider/-/js-service-provider-1.0.0.tgz","integrity":"sha512-qRRgdU2vmEsOj2vxHrFqQpjaeE4cTszFaFUAZZ5NNoTH+ER1ypuKOBFxat5QpBQr+Sp4sMYLKLPACOH9DysLtw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIAlJPFRcoVWuuYKB882Ebt9aU8mIa/tyGxkvZbJ6WZVwAiAuxfXYNB3wwWbRoFVUooUuGZ6Az4NTiy8Z7RnYwu2viA=="}]},"maintainers":[{"name":"aedart","email":"aedart@gmail.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/js-service-provider-1.0.0.tgz_1479029961959_0.022857400821521878"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.1.0":{"name":"@aedart/js-service-provider","version":"1.1.0","description":"Service Provider where you can register your IoC bindings","main":"index.js","scripts":{"test":"karma start karma.conf.js"},"repository":{"type":"git","url":"git+https://github.com/aedart/js-service-provider.git"},"keywords":["Service","Provider","IoC","Inversion of Control","Container"],"author":{"name":"Alin Eugen Deac","email":"aedart@gmail.com","url":"https://github.com/aedart"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/aedart/js-facade/issues"},"homepage":"https://github.com/aedart/js-facade#readme","dependencies":{"@aedart/js-facade":"^1.0.0","mixwith":"~0.1"},"devDependencies":{"@aedart/js-ioc":"^1.0.0","babel-plugin-external-helpers":"^6.18.0","babel-plugin-transform-builtin-extend":"^1.1.0","babel-preset-es2015-rollup":"^1.2.0","babel-preset-es2016":"^6.16.0","faker":"^3.1.0","jasmine":"^2.5.2","karma":"^1.3.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-ie-launcher":"^1.0.0","karma-jasmine":"^1.0.2","karma-phantomjs-launcher":"^1.0.2","karma-rollup-plugin":"^0.2.4","karma-spec-reporter":"0.0.26","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-plugin-buble":"^0.14.0","rollup-plugin-commonjs":"^5.0.5","rollup-plugin-eslint":"^3.0.0","rollup-plugin-node-builtins":"^2.0.0","rollup-plugin-node-globals":"^1.0.9","rollup-plugin-node-resolve":"^2.0.0","rollup-plugin-replace":"^1.1.1","rollup-plugin-uglify":"^1.0.1","uglify-js-harmony":"^2.6.2"},"gitHead":"9c72feea959b0df4783ad5786918d906a551cfe4","_id":"@aedart/js-service-provider@1.1.0","_shasum":"5c71e54da4f1640c0977a33d09deb4875e80d2cc","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"aedart","email":"aedart@gmail.com"},"dist":{"shasum":"5c71e54da4f1640c0977a33d09deb4875e80d2cc","tarball":"https://registry.npmjs.org/@aedart/js-service-provider/-/js-service-provider-1.1.0.tgz","integrity":"sha512-r3AZKA/tDF8nw8H+VTBpaTFR3cQziIruXQdawi1LO4AJYvck6JIeO4RXowO8CB5EWM3GfwSlIKXgLwjz8O8law==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF4WkgNKJvTpxIcB+eS3JEe44AtMkiREYUxXddBCkFmNAiEAzu2U4JFHH8jUeHbLvLrm1Yvf3ARImDmz90SN7nk6Eic="}]},"maintainers":[{"name":"aedart","email":"aedart@gmail.com"}],"_npmOperationalInternal":{"host":"packages-12-west.internal.npmjs.com","tmp":"tmp/js-service-provider-1.1.0.tgz_1483876796988_0.46012736670672894"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.2.0":{"name":"@aedart/js-service-provider","version":"1.2.0","description":"Service Provider where you can register your IoC bindings","main":"index.js","repository":{"type":"git","url":"git+https://github.com/aedart/js-service-provider.git"},"keywords":["Service","Provider","IoC","Inversion of Control","Container"],"author":{"name":"Alin Eugen Deac","email":"aedart@gmail.com","url":"https://github.com/aedart"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/aedart/js-facade/issues"},"homepage":"https://github.com/aedart/js-facade#readme","dependencies":{"@aedart/js-facade":"^1.0.0","@vcas/js-mixin":"~1.0"},"devDependencies":{"@aedart/js-ioc":"^1.2.0","babel-plugin-external-helpers":"^6.18.0","babel-plugin-transform-builtin-extend":"^1.1.0","babel-preset-es2015-rollup":"^1.2.0","babel-preset-es2016":"^6.16.0","faker":"^3.1.0","jasmine":"^2.5.2","karma":"^1.3.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-ie-launcher":"^1.0.0","karma-jasmine":"^1.0.2","karma-phantomjs-launcher":"^1.0.2","karma-rollup-plugin":"^0.2.4","karma-spec-reporter":"0.0.26","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-plugin-buble":"^0.14.0","rollup-plugin-commonjs":"^5.0.5","rollup-plugin-eslint":"^3.0.0","rollup-plugin-node-builtins":"^2.0.0","rollup-plugin-node-globals":"^1.0.9","rollup-plugin-node-resolve":"^2.0.0","rollup-plugin-replace":"^1.1.1","rollup-plugin-uglify":"^1.0.1","uglify-js-harmony":"^2.6.2"},"scripts":{"test":"karma start karma.conf.js"},"gitHead":"b1ab9368e609c9a42b54f98826d38aeda5b320f2","_id":"@aedart/js-service-provider@1.2.0","_shasum":"4cf28b769375cfeb3a302af9ce795721f144144c","_from":".","_npmVersion":"3.10.8","_nodeVersion":"6.8.1","_npmUser":{"name":"aedart","email":"aedart@gmail.com"},"dist":{"shasum":"4cf28b769375cfeb3a302af9ce795721f144144c","tarball":"https://registry.npmjs.org/@aedart/js-service-provider/-/js-service-provider-1.2.0.tgz","integrity":"sha512-ZqJ6ucS+91cVZkBTcMtY3TYHufoVlyZGLAKEqfYvBi53FRCAWf93Ogy7GkI1lL4ZYqkL/YTGScLXMzyIZlLjxQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIDBZMWIuRXscE6Tw/ipT5IYV4bK9voCp8P+3w4Gl+Xc6AiAPaeh5iDT21HVQwRMA8ePTtNSFQgrpLwTPVgw3LjXGuw=="}]},"maintainers":[{"name":"aedart","email":"aedart@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-service-provider-1.2.0.tgz_1496669284278_0.5180699110496789"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."},"1.2.1":{"name":"@aedart/js-service-provider","version":"1.2.1","description":"Service Provider where you can register your IoC bindings","main":"index.js","repository":{"type":"git","url":"git+https://github.com/aedart/js-service-provider.git"},"keywords":["Service","Provider","IoC","Inversion of Control","Container"],"author":{"name":"Alin Eugen Deac","email":"aedart@gmail.com","url":"https://github.com/aedart"},"license":"BSD-3-Clause","bugs":{"url":"https://github.com/aedart/js-facade/issues"},"homepage":"https://github.com/aedart/js-facade#readme","dependencies":{"@aedart/js-facade":"^1.1.1","@vestergaard-company/js-mixin":"^1.0.3"},"devDependencies":{"@aedart/js-ioc":"^1.2.1","babel-plugin-external-helpers":"^6.18.0","babel-plugin-transform-builtin-extend":"^1.1.0","babel-preset-es2015-rollup":"^1.2.0","babel-preset-es2016":"^6.16.0","faker":"^3.1.0","jasmine":"^2.5.2","karma":"^1.3.0","karma-chrome-launcher":"^2.0.0","karma-firefox-launcher":"^1.0.0","karma-ie-launcher":"^1.0.0","karma-jasmine":"^1.0.2","karma-phantomjs-launcher":"^1.0.2","karma-rollup-plugin":"^0.2.4","karma-spec-reporter":"0.0.26","rollup":"^0.36.3","rollup-plugin-babel":"^2.6.1","rollup-plugin-buble":"^0.14.0","rollup-plugin-commonjs":"^5.0.5","rollup-plugin-eslint":"^3.0.0","rollup-plugin-node-builtins":"^2.0.0","rollup-plugin-node-globals":"^1.0.9","rollup-plugin-node-resolve":"^2.0.0","rollup-plugin-replace":"^1.1.1","rollup-plugin-uglify":"^1.0.1","uglify-js-harmony":"^2.6.2"},"scripts":{"test":"karma start karma.conf.js"},"gitHead":"a1a0f21afbd85e890e878edb606860f7d400a478","_id":"@aedart/js-service-provider@1.2.1","_npmVersion":"5.0.3","_nodeVersion":"6.10.3","_npmUser":{"name":"aedart","email":"aedart@gmail.com"},"dist":{"integrity":"sha512-txG7G0ox7jPeiNmSXpcM1uwoWrxt7y8vkIZHzXkEPvK5vYwRSAHfVXoDs9oUJuCtgaoeaJt2Nm2JskNYiTbSXA==","shasum":"0ee596a1968b912ddaa0ca2a57ff197f3c674314","tarball":"https://registry.npmjs.org/@aedart/js-service-provider/-/js-service-provider-1.2.1.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDc2Tk2cbafyOyxTMigisyUX5uKmKDpDotqfRFPgbWwMgIhAKrY1tOp1gH3MRK8xUFQaALQTY9nP3oXi0zBnrN/7XgF"}]},"maintainers":[{"name":"aedart","email":"aedart@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/js-service-provider-1.2.1.tgz_1496819198885_0.9686734161805362"},"directories":{},"deprecated":"Package no longer supported. Contact Support at https://www.npmjs.com/support for more info."}},"readme":"# Js Service Provider\n\nService Provider abstraction that allows you to register your [IoC](https://en.wikipedia.org/wiki/Inversion_of_control) bindings.\n\nIt acts as support components for the [@aedart/js-ioc](https://www.npmjs.com/package/@aedart/js-ioc) package.\nPlease check it out, before you continue reading.\n\nFurthermore, just like the [@aedart/js-ioc](https://www.npmjs.com/package/@aedart/js-ioc) package, this too is inspired by [Taylor Otwell's](https://github.com/taylorotwell) [Laravel](https://laravel.com) version of [Service Providers](https://laravel.com/docs/master/providers). \n\n## Contents\n\n* [How to install](#how-to-install)\n* [Quick start](#quick-start)\n  * [Prerequisite](#prerequisite)\n  * [Create a provider](#create-a-provider)\n  * [Register and boot provider](#register-and-boot-provider)\n    * [Manually](#manually)\n    * [Service Registrar](#service-registrar)\n* [Contribution](#contribution)\n* [Acknowledgement](#acknowledgement)\n* [Versioning](#versioning)\n* [License](#license)\n\n\n## How to install\n\n```console\nnpm install @aedart/js-service-provider\n```\n\n## Quick start\n\n### Prerequisite \n\nThe Service Provider abstraction is meant to offer a place where you can register your IoC bindings, as well as application bootstrapping.\nIt has been designed to work with the [@aedart/js-ioc](https://www.npmjs.com/package/@aedart/js-ioc) package - Yet, there is no type check hereof, meaning that any Service Container can be used. \n\nIn any case, you should have some understanding of what [IoC](https://en.wikipedia.org/wiki/Inversion_of_control) means and \n\n### Create a provider\n\n```javascript\nimport ServiceProvider from '@aedart/js-service-provider';\n\nclass MyBoxServiceProvider extends ServiceProvider {\n\n    register(){\n        // Register box\n        this.ioc.bind('my-box', (ioc, params) => {\n            return new Box(params);\n        });\n    }\n\n    boot(){\n        // ... not shown ... //\n    }\n}\n```\n\n### Register and boot provider\n\nThere are two ways that you can register your provider;\n\n1) You can register and boot your provider manually\n2) You can use the Service Registrar\n\n#### Manually\n\nGiven that you have an IoC ready to be used, somewhere in your application bootstrap logic.\n\n```javascript\nlet provider = new MyBoxServiceProvider(IoC);\n\n// Register bindings\nprovider.register();\n\n// Boot the services\nprovider.boot();\n```\n\n#### Service Registrar\n\nThe Service Registrar allows you to register and boot a bulk of providers. It also keeps track of the provider's boot state; has boot or not!\n\n```javascript\nimport { Registrar } from '@aedart/js-service-provider';\n\nlet registrar = new Registrar(IoC);\n\n// ... Given that you have a set of service providers ... //\n\n// Register and boot\nregistrar.registerProviders([\n    CalculatorServiceProvider,\n    MyBoxServiceProvider,\n    GfxServiceProvider,\n    AnimationServiceProvider\n]);\n```\n\n**Delay booting of providers**\n\nSometimes it is useful to register your providers, but not to boot them straight away.\n\n```javascript\nimport { Registrar } from '@aedart/js-service-provider';\n\nlet registrar = new Registrar(IoC);\n\n// ... Given that you have a set of service providers ... //\n\n// Register - but do NOT boot\nregistrar.registerProviders([\n    CalculatorServiceProvider,\n    MyBoxServiceProvider,\n    GfxServiceProvider,\n    AnimationServiceProvider\n], false);\n\n// Later in your application ...\nregistrar.bootProviders();\n```\n\nCheck out the `Registrar`'s source code, for additional information. \n\n## Contribution\n\nHave you found a defect ( [bug or design flaw](https://en.wikipedia.org/wiki/Software_bug) ), or do you wish improvements? In the following sections, you might find some useful information\non how you can help this project. In any case, I thank you for taking the time to help me improve this project's deliverables and overall quality.\n\n### Bug Report\n\nIf you are convinced that you have found a bug, then at the very least you should create a new issue. In that given issue, you should as a minimum describe the following;\n\n* Where is the defect located\n* A good, short and precise description of the defect (Why is it a defect)\n* How to replicate the defect\n* (_A possible solution for how to resolve the defect_)\n\nWhen time permits it, I will review your issue and take action upon it.\n\n### Fork, code and send pull-request\n\nA good and well written bug report can help me a lot. Nevertheless, if you can or wish to resolve the defect by yourself, here is how you can do so;\n\n* Fork this project\n* Create a new local development branch for the given defect-fix\n* Write your code / changes\n* Create executable test-cases (prove that your changes are solid!)\n* Commit and push your changes to your fork-repository\n* Send a pull-request with your changes\n* _Drink a [Beer](https://en.wikipedia.org/wiki/Beer) - you earned it_ :)\n\nAs soon as I receive the pull-request (_and have time for it_), I will review your changes and merge them into this project. If not, I will inform you why I choose not to.\n\n## Acknowledgement\n\n* [Taylor Otwell](https://github.com/taylorotwell), for his [IoC](https://laravel.com/docs/master/container) and [Service Provider](https://laravel.com/docs/master/providers) implementation\n\n## Versioning\n\nThis package follows [Semantic Versioning 2.0.0](http://semver.org/)\n\n## License\n\n[BSD-3-Clause](http://spdx.org/licenses/BSD-3-Clause), Read the LICENSE file included in this package","maintainers":[{"name":"aedart","email":"aedart@gmail.com"}],"time":{"modified":"2023-02-16T11:37:12.766Z","created":"2016-11-06T13:29:20.516Z","0.9.0":"2016-11-06T13:29:20.516Z","1.0.0":"2016-11-13T09:39:22.573Z","1.1.0":"2017-01-08T11:59:59.121Z","1.2.0":"2017-06-05T13:28:05.252Z","1.2.1":"2017-06-07T07:06:39.761Z"},"homepage":"https://github.com/aedart/js-facade#readme","keywords":["Service","Provider","IoC","Inversion of Control","Container"],"repository":{"type":"git","url":"git+https://github.com/aedart/js-service-provider.git"},"author":{"name":"Alin Eugen Deac","email":"aedart@gmail.com","url":"https://github.com/aedart"},"bugs":{"url":"https://github.com/aedart/js-facade/issues"},"license":"BSD-3-Clause","readmeFilename":"README.md"}