{"_id":"dips","_rev":"31-6f530149ba6763787b5397e7afaa3c9c","name":"dips","description":"A simple yet powerful dependency injection and entity (file) management framework for Node.js","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"dips","description":"NodeJS Dependency Injection","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject"],"version":"0.1.0","license":"MIT","author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x"},"files":["lib","test","dips.js"],"main":"./dips.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.0","dist":{"shasum":"147f13dafce8eb7487e385185b2d4d5c4fe18a88","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.0.tgz","integrity":"sha512-12IYLbe1652OJAyWX16zEY6jwBn+Rqa+5w48BvN9jd9f1q/0YHs8D+7zleK0HPPVdnbSLs42XBEItTT4NXqbjQ==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDlMzjx9lgCiVfMEnjBcoMyZG850uKfOT5dU4Ga/MLqGAIhAM031E12nYY0is0RPh2I2SHsAS4ixFSbIFuUwyugioN9"}]},"_from":".","_npmVersion":"1.3.23","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.1":{"name":"dips","description":"A simple yet powerfull dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.1","license":"MIT","author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x"},"files":["lib","test","dips.js"],"main":"./dips.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.1","dist":{"shasum":"0c7d84c7c5bb704fe1402d6359a718c8ee5740df","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.1.tgz","integrity":"sha512-KS6Z84iASKEdFS5X66x8v/nPZAbWLEQVltqOADFJmLvSFSo4ptCE9ym2Dth4GXEsPj84QpDlmM5lX4bwlHOVrg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCSIh6R9gz8QsWYVNhzpg8H9ydJECAAtUDgEhDZH/Ya1wIhAOq69kPd15RBp58Q3KQPwbFl2OhEbdAws1+Tj8gALq9a"}]},"_from":".","_npmVersion":"1.3.23","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.2":{"name":"dips","description":"A simple yet powerfull dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.2","license":"MIT","author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x"},"files":["lib","test","dips.js"],"main":"./dips.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.2","dist":{"shasum":"2df62a54ecec05a969e7ee53de542c8df94741b7","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.2.tgz","integrity":"sha512-7opTvBfLoG0XnOIzSr5f6zveQ/21O6unffwiXUF4aVGSYhCZNpMIs9L3f7NlIRJf//HBw4yI+cpCCbF7Kmr9WA==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCQ4SnPxGx244t8n5fpcVSs82lVmhdGIj2rg2bZJ5l+SgIhAL+lcdjHl6h2DXWkPH+r2aGO9Rk5vo/Jk+CWSnLoxVin"}]},"_from":".","_npmVersion":"1.3.23","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.3":{"name":"dips","description":"A simple yet powerful dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.3","license":{"type":"MIT","url":"https://raw.github.com/devcrust/node-dips/master/LICENSE"},"author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x"},"files":["lib","test","dips.js"],"main":"./dips.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.3","dist":{"shasum":"4190a0a043b03db536bec6325c579fc047c7df87","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.3.tgz","integrity":"sha512-j0PT5vlqNIjropqrrraW5vzmQCiAjY1k+HsIbeHJUau3BVHvLRBaGGOURv9E+sCoHvSt6DOzEkCw88SP4I4Y7g==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIF43ZiQ2Pcce5KGyMKfXjL4C6sgw3puhPIQ13BGcrgJGAiEAp6ig7jWO+cRadJ8uuCFin85VBdHqvZ8ZiDQeR+66zxs="}]},"_from":".","_npmVersion":"1.3.22","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.4":{"name":"dips","description":"A simple yet powerful dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.4","license":{"type":"MIT","url":"https://raw.github.com/devcrust/node-dips/master/LICENSE"},"author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x"},"files":["lib","test","dips.js"],"main":"./dips.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.4","dist":{"shasum":"2f4e58f6b6e2704cff4c2a4cf1c2bf08924774c1","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.4.tgz","integrity":"sha512-OKfvF6GXV8MwwGSCd7Q+1FbTDUtOPQc6hvt902faz2BzeDEo0SOr0H5W0OsXmg3p5EmJiLbfBzE4rTlwmR4ptw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQC2ft7kLEYlX6wGCOEzSjesVHZZlh/0BFhVGkWmmFytXgIhAJ2NxADFF2N2yQVGx9Mx3pYoxhJbUXjRhNUaCzsjUCYD"}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.5":{"name":"dips","description":"A simple yet powerful dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.5","license":{"type":"MIT","url":"https://raw.github.com/devcrust/node-dips/master/LICENSE"},"author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x"},"files":["lib","test","dips.js"],"main":"./dips.js","scripts":{"test":"NODE_ENV=test ./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.5","dist":{"shasum":"1f1c4ec1c367175cc28d4d6cd5fcfdeca9c4c8f1","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.5.tgz","integrity":"sha512-mi6Xl4gDasM4l1BwJDWl0bgREBq/63xRHPGhtPd84Dbll/BZxDr3ggO6VoVJUVRB5I0RIBAUnGspM2T2t+gcew==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQDBPwLH+VsU0RBILpnw8eCKnin3rkZA0UJ1Ge3WKjk12AIhANrLuANQqc5UHdr41gyms9fy+Hyj3Zy/Cw6FKUfSSguu"}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.6":{"name":"dips","description":"A simple yet powerful dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.6","license":{"type":"MIT","url":"https://raw.github.com/devcrust/node-dips/master/LICENSE"},"author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x","mocha-lcov-reporter":"0.0.x","coveralls":"2.7.x","blanket":"1.1.x"},"files":["lib","test","dips.js"],"main":"./dips.js","config":{"blanket":{"pattern":"src"}},"scripts":{"test":"./node_modules/.bin/mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","test-coverage":"./node_modules/.bin/mocha --require blanket --reporter mocha-lcov-reporter --ui tdd | ./node_modules/coveralls/bin/coveralls.js","coverage":"./node_modules/.bin/mocha --require blanket --reporter html-cov --ui tdd > docs/report/coverage.html","build-doc":"jsdoc --destination docs --recurse --private lib/ dips.js"},"_id":"dips@0.1.6","dist":{"shasum":"1ae61b7849d85704f1f04d23a2b77656d11a6823","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.6.tgz","integrity":"sha512-I3Jdey1AHu8out1v6hdNoKxCCXw5vko+Gg/XBt0w4uWvvgRhawmBrN/zHcXFsvAumALegAcxI7Ks98B9Q1K+5Q==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIDUZHk8Kt7m2gZP17Msrv9yS2nOUGkDQcNLttTbsD8TKAiEA1+0KWBXnCVedtIPY5XDaVKR5GmVmccvJ6vRJkI0IDrs="}]},"_from":".","_npmVersion":"1.3.21","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"directories":{}},"0.1.7":{"name":"dips","description":"A simple yet powerful dependency injection and entity (file) management framework for Node.js","homepage":"http://devcrust.github.io/node-dips","keywords":["di","dependency injection","ioc","inversion of control","dependency","injection","inject","entity","management"],"version":"0.1.7","license":{"type":"MIT","url":"https://raw.github.com/devcrust/node-dips/master/LICENSE"},"author":{"name":"Christoph Rust","email":"chr.rust@googlemail.com"},"contributors":[{"name":"Christoph Rust","email":"chr.rust@googlemail.com"}],"repository":{"type":"git","url":"git://github.com/devcrust/node-dips.git"},"bugs":{"url":"https://github.com/devcrust/node-dips/issues"},"engines":{"node":">= 0.8.x"},"dependencies":{},"devDependencies":{"mocha":"1.17.x","chai":"1.9.x","mocha-lcov-reporter":"0.0.x","coveralls":"2.7.x","blanket":"1.1.x"},"files":["lib","test","dips.js"],"main":"./dips.js","config":{"blanket":{"pattern":"src"}},"scripts":{"test":"mocha --reporter spec --ui tdd --timeout 5000 --slow 100 --colors --bail --recursive test/","test-coverage":"mocha --require blanket --reporter mocha-lcov-reporter --ui tdd | ./node_modules/coveralls/bin/coveralls.js","coverage":"mocha --require blanket --reporter html-cov --ui tdd > docs/report/coverage.html","build-doc":"jsdoc --destination docs --recurse --private src/lib/ src/dips.js"},"_id":"dips@0.1.7","dist":{"shasum":"67538180c206670a85b00ece16841e7054e15938","tarball":"https://registry.npmjs.org/dips/-/dips-0.1.7.tgz","integrity":"sha512-10b3nMPC80+bo0nO8s1gbmibLtgfjOif8wCLGRlIODiJl8aAzccCr7Spl4V8Cv6zC2vCSq3gJHjukyeuLSBzuw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFI9b9j8nq/if4xUQ2/ijq9BRSSWolyISQBcx8Ylw2OzAiAu2xUVtN2sqw318LPNAkmZh4RMIhX0mNJOLojl3Bjcyw=="}]},"_from":".","_npmVersion":"1.3.25","_npmUser":{"name":"devcrust","email":"chr.rust@googlemail.com"},"maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}]}},"readme":"# Dips\n\n[![NPM version](https://badge.fury.io/js/dips.png)](http://badge.fury.io/js/dips)\n[![Build Status](https://travis-ci.org/devcrust/node-dips.png?branch=master)](https://travis-ci.org/devcrust/node-dips)\n[![Dependency Status](https://gemnasium.com/devcrust/node-dips.png)](https://gemnasium.com/devcrust/node-dips)\n[![Coverage Status](https://coveralls.io/repos/devcrust/node-dips/badge.png?branch=master)](https://coveralls.io/r/devcrust/node-dips?branch=master)\n[![Stories in Ready](https://badge.waffle.io/devcrust/node-dips.png?label=ready)](https://waffle.io/devcrust/node-dips)\n\nA simple yet powerful dependency injection and entity (file) management framework for Node.js\n\n[![NPM](https://nodei.co/npm/dips.png)](https://nodei.co/npm/dips/)\n\n---\n\n## Features\n\n* Inject all types of dependencies (Function, Object/Instance, Array, Boolean, String, Number, etc.)\n* Support for Node.js core and NPM dependencies out of the box\n* File entity resolver (folder/sub-folder/file.js becomes `Dips.$.folder.sub-folder.file`)\n* Fast (lazy loading support)\n* Re-register dependencies\n* Supports multiple containers/scopes\n* Has no dependencies of its own\n\n---\n\n## Installation\n\nTo install the latest stable version:\n\n```sh\nnpm install dips\n```\n\n---\n\n## Examples\n\n### Create a new instance\n\nCreate a new `Dips` instance:\n\n```js\nvar Dips = require('dips'),\n    dips = Dips({\n    \n        entities : {\n            \n            files : {\n                basePath : __dirname,\n                paths    : ['lib']     \n            }\n          \n        },\n    \n        dependencies : {\n            core : true,\n            npm  : true\n        }\n    \n    });\n```\n\n### Register dependencies\n\nRegister new dependencies by calling `Dips.setDependency`:\n\n```js\n// Register \"config\" dependency\ndips.setDependency('db_config', {\n\n    host : 'localhost',\n    port : '3306',\n    user : 'root',\n    password : 'secret'\n\n});\n\n// Register \"db\" dependency\ndips.setDependency('db', function($db_config, $mysql) // $mysql registered by the \"npm\" dependencies\n{\n    return $mysql.createConnection($db_config);\n});\n```\n\n### Resolve dependencies\n\nResolve a dependency by calling `Dips.invoke`:\n\n```js\n// Example I: Invoke function\ndips.invoke(function($db, callback)\n{\n    $db.query('SELECT * FROM sometable', function(error, rows)\n    {\n        // ...\n    });\n});\n\n// Example II: Invoke function\ndips.invoke(function($fs, $path) // $fs and $path registered by the \"core\" dependencies\n{\n    $fs.readdirSync($path.resolve(__dirname, '..'));\n});\n```\n\n### Get (file) entities\n\nGet (file) entities by using the object `Dips.$` or the function `Dips.resolve`:\n\n```js\n// Useful if your IDE supports auto completion based on JSDOC (like PhpStorm)\ndips.$.lib.database.connection // equals: require('./lib/database/connection.js)\n\n// Using just a string (for instance from configurations)\ndips.resolve('lib.database.connection') // equals: require('./lib/database/connection.js)\n\n// Using the shortcut function\ndips.$('lib.database.connection') // equals: require('./lib/database/connection.js)\n\n```\n\n---\n\n## API\n\n### Dips\n\n---\n\n#### Options for `Dips()`\n\n* `entities ([Object.<String, *>])` - the entities to register _(optional)_\n    - `files ([Object.<String, *>])` - the file entities to register _(optional)_\n        - `basePath (String)` - the absolute base path to use\n        - `paths (String | Array.<String> | Object.<String, String>)` - the file paths to parse, relative to the given `basePath`\n        - `prefix ([String=\"\"])` - the prefix to use e.g. \"app\" -> \"app\\_myentity\", etc. _(optional)_\n\n* `dependencies ([Object.<String, *>])` - the dependencies to register for the default container (optional)\n    - `core ([Object.<String, *> | *])` - if present (typically with the value of `true`), registers the Node.js core modules e.g. fs, path, http, etc. as dependencies _(optional)_\n        - `prefix ([String=\"\"])` - the optional prefix to use e.g. \"core\" -> \"core\\_fs\", etc. _(optional)_\n    - `npm ([Object.<String, *> | *])` - if present (typically with the value of `true`), registers the installed NPM modules (behaves like [module.require](http://nodejs.org/api/modules.html#modules_all_together)) as dependencies _(optional)_\n        - `prefix ([String=\"\"])` - the optional prefix to use e.g. \"npm\" -> \"npm\\_express\", etc. _(optional)_\n        - `ignore ([Array.<String, RegExp>])` - the optional ignores added to the default ignores \".bin\" and \".gitignore\" _(optional)_\n    - `...` - the custom dependencies to register, dependency id as key `String` _(optional)_\n* `containers ([Object.<String, Container>])` - the dependency containers to register _(optional)_\n\n---\n\n#### Properties\n\n##### `Entities`\n\n* `$ (Function)` - the entity resolver function and registry object (_alias for `Dips.resolve`_)\n\n```js\n// Useful if your IDE supports auto completion based on JSDOC (like PhpStorm)\ndips.$.lib.database.connection // equals: require('./lib/database/connection.js)\n\n// Using the shortcut function\ndips.$('lib.database.connection') // equals: require('./lib/database/connection.js)\n```\n\n#### Methods\n\n---\n\n##### `Entities`\n\n* `addEntities(Object.<String, *> values)` - adds the given custom entities\n\n* `resolve(String value)` - resolves the entity with the given name e.g. \"lib.database.connection\", etc.\n\n---\n\n##### `Containers`\n\n* `getContainers()` - returns the ids of the registered dependency containers\n\n* `setContainers(Object.<String, *> values)` - sets and overrides the given dependency containers\n\n* `hasContainer(String id)` - checks if the dependency container with given id does exist\n\n* `getContainer(String id)` - returns the dependency container with the given id\n\n* `setContainer(String id, Container value)` - sets the dependency container with the given id and value\n\n##### `Dependencies`\n\n_The following methods are inherited from `Container`_\n\n* `getDependencies()` - returns the ids of the registered dependencies within the `defaultContainer`\n\n* `setDependencies(Object.<String, *> values)` - sets and overrides the given dependencies within the `defaultContainer`\n\n* `addDependencies(Object.<String, *> values)` - adds the given dependencies within the `defaultContainer`\n\n* `hasDependency(String id)` - checks if the dependency with the given id does exist within the `defaultContainer`\n\n* `getDependency(String id)` - returns the dependency with the given id from the `defaultContainer`\n\n* `setDependency(String id, * value)` - sets the dependency with the given id and value within the `defaultContainer`\n\n* `invoke(Function|Array|Object|String|* value)` - invokes the given value with the dependencies from the `defaultContainer` and the provided additional _(non dependency)_ arguments\n\n---\n\n### Invoke explained\n\n##### Invoke with `Function`\n\nAll function parameters starting with `$` will be replaced with the value of the corresponding dependency, `undefined` otherwise.  \nIt is possible to pass additional function arguments (indicated without a leading `$`). The additional arguments must be passed in the corresponding order of the function parameters.  \n\nConsider the following function parameters: `foo, $db, bar, $fs`:  \nThe additional arguments must be passed in the following order: `'value of foo', 'value of bar'`\n\n###### Example\n\n```js\n// Invoke function\ndips.invoke(function($db)\n{\n    // $db is equal to dips.getDependency('db')\n});\n\n// Invoke function with additional arguments\ndips.invoke(function($db, query)\n{\n    // $db is equal to dips.getDependency('db')\n    // query is equal to the given argument\n}, 'SELECT * FROM sometable');\n```\n\n##### Invoke with `Array`\n\nBy passing an array to `Dips.invoke()`, the array values will be iterated and all `String` values starting with `$` will be replaced with the value of the corresponding dependency, `undefined` otherwise.\n\n###### Example\n\n```js\n// Invoke array\ndips.invoke(['$fs', '$path', {}]); // $fs and $path will be replaced with the corresponding\n```\n\n##### Invoke with `Object`\n\nIf an object is passed to `Dips.invoke()`, the object will be iterated and the value of the `keys` starting with `$` will be replaced with the corresponding dependency, `undefined` otherwise.\n\n###### Example\n\n```js\n// Invoke object\ndips.invoke({\n\n    $db_config : null, // value will be equal to dips.getDependency('db_config')\n    $mysql     : null, // value will be equal to dips.getDependency('mysql') or require('mysql')\n    query      : 'SELECT * FROM sometable'\n\n});\n```\n\n__Passing other types (`string`, `number`, `boolean`, `null`, `undefined`) as value for `Dips.invoke` will be returned as they are, without modification.__\n\n## License\n\n[The MIT License (MIT)](http://opensource.org/licenses/MIT)\n\nCopyright (c) 2014 - Christoph Rust\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n[![Analytics](https://ga-beacon.appspot.com/UA-47502134-1/node-dips/readme)]()","maintainers":[{"name":"devcrust","email":"chr.rust@googlemail.com"}],"time":{"modified":"2022-06-15T04:22:53.030Z","created":"2014-01-18T23:01:16.604Z","0.1.0":"2014-01-18T23:01:16.604Z","0.1.1":"2014-01-18T23:04:06.947Z","0.1.2":"2014-01-19T18:46:49.691Z","0.1.3":"2014-01-22T20:28:53.811Z","0.1.4":"2014-01-22T22:17:44.993Z","0.1.5":"2014-01-22T22:38:18.726Z","0.1.6":"2014-01-22T22:51:56.963Z","0.1.7":"2014-02-07T12:11:20.807Z"},"readmeFilename":"README.md"}