Socket
Socket
Sign inDemoInstall

knifecycle

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

knifecycle - npm Package Compare versions

Comparing version 2.3.0 to 2.4.0

dist/build.js

10

CHANGELOG.md

@@ -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)

2

package.json
{
"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.&lt;String&gt;</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.&lt;String&gt;</code>
Create a JavaScript module that initialize
a set of dependencies with hardcoded
import/awaits.
**Kind**: global function
**Returns**: <code>Promise.&lt;String&gt;</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.&lt;String&gt;</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 @@

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc