|
1 |
| -# Dips [](https://travis-ci.org/devcrust/node-dips) |
| 1 | +# Dips [](http://badge.fury.io/js/dips) [](https://travis-ci.org/devcrust/node-dips) |
2 | 2 |
|
3 |
| -A simple yet powerfull dependency injection and entity (file) management framework for Node.js |
| 3 | +A simple yet powerful dependency injection and entity (file) management framework for Node.js |
| 4 | + |
| 5 | +[](https://nodei.co/npm/dips/) |
4 | 6 |
|
5 | 7 | ---
|
6 | 8 |
|
7 | 9 | ## Features
|
8 | 10 |
|
9 | 11 | * Inject all types of dependencies (Function, Object/Instance, Array, Boolean, String, Number, etc.)
|
10 | 12 | * Support for Node.js core and NPM dependencies out of the box
|
11 |
| -* File entity resolver (folder/subfolder/file.js becomes `Dips.$.folder.subfolder.file`) |
| 13 | +* File entity resolver (folder/sub-folder/file.js becomes `Dips.$.folder.sub-folder.file`) |
12 | 14 | * Fast (lazy loading support)
|
13 | 15 | * Re-register dependencies
|
14 | 16 | * Supports multiple containers/scopes
|
@@ -90,7 +92,7 @@ dips.invoke(function($db, callback)
|
90 | 92 | });
|
91 | 93 |
|
92 | 94 | // Example II: Invoke function
|
93 |
| -dips.invoke(function($fs, $path) // $fs and $path registred by the "core" dependencies |
| 95 | +dips.invoke(function($fs, $path) // $fs and $path registered by the "core" dependencies |
94 | 96 | {
|
95 | 97 | $fs.readdirSync($path.resolve(__dirname, '..'));
|
96 | 98 | });
|
@@ -133,6 +135,7 @@ dips.$('lib.database.connection') // equals: require('./lib/database/connection.
|
133 | 135 | - `prefix ([String=""])` - the optional prefix to use e.g. "core" -> "core\_fs", etc. _(optional)_
|
134 | 136 | - `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)_
|
135 | 137 | - `prefix ([String=""])` - the optional prefix to use e.g. "npm" -> "npm\_express", etc. _(optional)_
|
| 138 | + - `ignore ([Array.<String, RegExp>])` - the optional ignores added to the default ignores ".bin" and ".gitignore" _(optional)_ |
136 | 139 | - `...` - the custom dependencies to register, dependency id as key `String` _(optional)_
|
137 | 140 | * `containers ([Object.<String, Container>])` - the dependency containers to register _(optional)_
|
138 | 141 |
|
@@ -184,7 +187,7 @@ _The following methods are inherited from `Container`_
|
184 | 187 |
|
185 | 188 | * `setDependencies(Object.<String, *> values)` - sets and overrides the given dependencies within the `defaultContainer`
|
186 | 189 |
|
187 |
| -* `addDependencies(Object.<String, *> values)` - addes the given dependencies within the `defaultContainer` |
| 190 | +* `addDependencies(Object.<String, *> values)` - adds the given dependencies within the `defaultContainer` |
188 | 191 |
|
189 | 192 | * `hasDependency(String id)` - checks if the dependency with the given id does exist within the `defaultContainer`
|
190 | 193 |
|
@@ -251,4 +254,28 @@ dips.invoke({
|
251 | 254 | });
|
252 | 255 | ```
|
253 | 256 |
|
254 |
| -__Passing other types (`string`, `number`, `boolean`, `null`, `undefined`) as value for `Dips.invoke` will be returned as they are, without modification.__ |
| 257 | +__Passing other types (`string`, `number`, `boolean`, `null`, `undefined`) as value for `Dips.invoke` will be returned as they are, without modification.__ |
| 258 | + |
| 259 | +## License |
| 260 | + |
| 261 | +[The MIT License (MIT)](http://opensource.org/licenses/MIT) |
| 262 | + |
| 263 | +Copyright (c) 2014 - Christoph Rust |
| 264 | + |
| 265 | +Permission is hereby granted, free of charge, to any person obtaining a copy |
| 266 | +of this software and associated documentation files (the "Software"), to deal |
| 267 | +in the Software without restriction, including without limitation the rights |
| 268 | +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
| 269 | +copies of the Software, and to permit persons to whom the Software is |
| 270 | +furnished to do so, subject to the following conditions: |
| 271 | + |
| 272 | +The above copyright notice and this permission notice shall be included in |
| 273 | +all copies or substantial portions of the Software. |
| 274 | + |
| 275 | +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR |
| 276 | +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, |
| 277 | +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE |
| 278 | +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER |
| 279 | +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, |
| 280 | +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN |
| 281 | +THE SOFTWARE. |
0 commit comments