knifecycle
Advanced tools
Comparing version 2.3.0 to 2.4.0
@@ -0,1 +1,11 @@ | ||
<a name="2.4.0"></a> | ||
# [2.4.0](https://github.com/nfroidure/knifecycle/compare/v2.3.0...v2.4.0) (2017-11-07) | ||
### Features | ||
* **Build:** Allow to build initialization modules ([1aaca1b](https://github.com/nfroidure/knifecycle/commit/1aaca1b)) | ||
<a name="2.3.0"></a> | ||
@@ -2,0 +12,0 @@ # [2.3.0](https://github.com/nfroidure/knifecycle/compare/v2.2.2...v2.3.0) (2017-10-30) |
{ | ||
"name": "knifecycle", | ||
"version": "2.3.0", | ||
"version": "2.4.0", | ||
"description": "Manage your NodeJS processes's lifecycle.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -65,3 +65,5 @@ <!-- | ||
services references if you really need to; | ||
- generate Mermaid graphs of the dependency tree. | ||
- generate Mermaid graphs of the dependency tree; | ||
- build raw initialization modules to avoid | ||
embedding Knifecycle in your builds. | ||
@@ -344,2 +346,7 @@ ## Usage | ||
<dl> | ||
<dt><a href="#buildInitializer">buildInitializer(constants, loader, dependencies)</a> ⇒ <code>Promise.<String></code></dt> | ||
<dd><p>Create a JavaScript module that initialize | ||
a set of dependencies with hardcoded | ||
import/awaits.</p> | ||
</dd> | ||
<dt><a href="#reuseSpecialProps">reuseSpecialProps(from, to, [amend])</a> ⇒ <code>function</code></dt> | ||
@@ -355,2 +362,9 @@ <dd><p>Apply special props to the given function from another one</p> | ||
</dd> | ||
<dt><a href="#extra">extra(extraInformations, initializer, [merge])</a> ⇒ <code>function</code></dt> | ||
<dd><p>Decorator creating a new initializer with some | ||
extra informations appended to it. It is just | ||
a way for user to store some additional | ||
informations but has no interaction with the | ||
Knifecycle internals.</p> | ||
</dd> | ||
<dt><a href="#options">options(options, initializer, [merge])</a> ⇒ <code>function</code></dt> | ||
@@ -624,2 +638,24 @@ <dd><p>Decorator to amend an initializer options.</p> | ||
``` | ||
<a name="buildInitializer"></a> | ||
## buildInitializer(constants, loader, dependencies) ⇒ <code>Promise.<String></code> | ||
Create a JavaScript module that initialize | ||
a set of dependencies with hardcoded | ||
import/awaits. | ||
**Kind**: global function | ||
**Returns**: <code>Promise.<String></code> - The JavaScript module content | ||
| Param | Type | Description | | ||
| --- | --- | --- | | ||
| constants | <code>Object</code> | An hash for simple constants | | ||
| loader | <code>function</code> | The dependency auto-loader | | ||
| dependencies | <code>Array.<String></code> | The main dependencies | | ||
**Example** | ||
```js | ||
import buildInitializer from 'knifecycle/src/build'; | ||
buildInitializer(constants, loader, ['entryPoint']); | ||
``` | ||
<a name="reuseSpecialProps"></a> | ||
@@ -677,2 +713,30 @@ | ||
``` | ||
<a name="extra"></a> | ||
## extra(extraInformations, initializer, [merge]) ⇒ <code>function</code> | ||
Decorator creating a new initializer with some | ||
extra informations appended to it. It is just | ||
a way for user to store some additional | ||
informations but has no interaction with the | ||
Knifecycle internals. | ||
**Kind**: global function | ||
**Returns**: <code>function</code> - Returns a new initializer | ||
| Param | Type | Default | Description | | ||
| --- | --- | --- | --- | | ||
| extraInformations | <code>Object</code> | | An object containing those extra informations. | | ||
| initializer | <code>function</code> | | The initializer to tweak | | ||
| [merge] | <code>Boolean</code> | <code>false</code> | Whether the extra object should be merged with the existing one or not | | ||
**Example** | ||
```js | ||
import { extra, getInstance } from 'knifecycle' | ||
import myServiceInitializer from './service'; | ||
getInstance() | ||
.service('myService', | ||
extra({ httpHandler: true }, myServiceInitializer) | ||
); | ||
``` | ||
<a name="options"></a> | ||
@@ -679,0 +743,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
232582
24
5118
890