|
3 | 3 | [](https://www.npmjs.com/package/skippy) |
4 | 4 | [](https://travis-ci.org/rezzza/skippy) |
5 | 5 |
|
6 | | -Skippy is design to be an easy to use, robust, and well tested dependencies container. No magic inside. |
| 6 | +Skippy is designed to be an easy to use, robust, and well tested dependencies container. No magic inside. |
7 | 7 |
|
8 | | -#### What Skippy does |
9 | | -- Instantiate service as you describe in the configuration |
10 | | -- Configure what should be use as service constructor parameters: you can another services as reference, parameters, or any values you have configure |
11 | | -- Manage singleton instance of service (not defined by design pattern, but by configuration) |
12 | | -- Check the dependencies graph to avoid cyclic dependencies (only on development environement: `process.env.NODE_ENV === 'development'`) |
| 8 | +#### What Skippy do |
| 9 | +- Instantiate service as described in the dependencies configuration. |
| 10 | +- Configure what should be used as service constructor parameters: you can pass another services as reference, parameters, or any values you have configured. |
| 11 | +- Manage singleton instance of service (not defined by design pattern, but by configuration). |
| 12 | +- Check the dependencies graph to avoid cyclic dependencies (only on development environement: `process.env.NODE_ENV === 'development'`). |
13 | 13 |
|
14 | | -#### What Skippy doesn't do (and never will) |
15 | | -- Introspect JSDoc or parameters name to determine witch service should be inject in a constructor function. You need define service dependencies in a configuration file |
| 14 | +#### What Skippy don't do (and never will) |
| 15 | +- Introspect JSDoc or parameters name to determine witch service should be inject in a constructor function. You have to define service dependencies in a configuration file. |
16 | 16 | - Coffee |
17 | 17 |
|
18 | | -#### What Skippy doesn't do for now (but maybe one day) |
| 18 | +#### What Skippy don't at the moment (maybe one day) |
19 | 19 | - Use factory service to generate another service |
20 | 20 | - Generate a lazy loading proxy function |
21 | | -- Manage service scope (allowing private service, who can only be used to instantiate other service, not retrieved by the enduser) |
| 21 | +- Manage service scope (allowing private service, who can only be used to instantiate other service, not exposed to the world) |
22 | 22 |
|
23 | 23 |
|
24 | 24 | ## Installation |
@@ -104,15 +104,15 @@ module.exports = [ |
104 | 104 | ``` |
105 | 105 |
|
106 | 106 | A service configuration have four possible keys: |
107 | | -- `name` (`string`, mandatory): the service name |
108 | | -- `service` (`function`, mandatory): the service constructor function reference |
109 | | -- `singleton` (`boolean`, optional, default `true`): If `true`, the service will be a singleton. If `false`, a new service will be instantiated each time |
| 107 | +- `name` (`string`, mandatory): the service name. |
| 108 | +- `service` (`function`, mandatory): the service constructor function reference. |
| 109 | +- `singleton` (`boolean`, optional, default `true`): If `true`, the service will be a singleton. If `false`, a new service will be instantiated each time. |
110 | 110 | - `arguments` (`array`, optional, default empty array): An array of the value to inject in the service constructor (see "Arguments" section for more informations). |
111 | 111 |
|
112 | 112 |
|
113 | 113 | ### Arguments |
114 | 114 |
|
115 | | -They have three types of arguments type: |
116 | | -- A string like `@foo`: use another service as argument value (here an instance of the service named `foo`) |
117 | | -- A string like `%baz%`: use the corresponding parameter value as argument (here the `baz` parameter) |
118 | | -- Any other value (scalar, object, function...) will be directly use as argument |
| 115 | +3 types of arguments type: |
| 116 | +- A string like `@foo`: use another service as argument value (here an instance of the service named `foo`). |
| 117 | +- A string like `%baz%`: use the corresponding parameter value as argument (here the `baz` parameter). |
| 118 | +- Any other value (scalar, object, function...) will be directly used as an argument. |
0 commit comments