attach-ware
Advanced tools
Comparing version 1.0.0 to 1.1.0
@@ -1,6 +0,11 @@ | ||
<!--mdast setext--> | ||
<!--remark setext--> | ||
<!--lint disable no-multiple-toplevel-headings--> | ||
1.1.0 / 2016-02-12 | ||
================== | ||
* Remove Bower, Component, Duo support ([`6841e8d`](https://github.com/wooorm/attach-ware/commit/6841e8d)) | ||
1.0.0 / 2015-07-27 | ||
================== |
@@ -40,2 +40,4 @@ /** | ||
/* eslint-env commonjs */ | ||
var slice = [].slice; | ||
@@ -71,3 +73,3 @@ var unherit = require('unherit'); | ||
* @this {AttachWare} | ||
* @param {Function} attach | ||
* @param {Function} attach - Attacher. | ||
* @return {AttachWare} - `this`. | ||
@@ -74,0 +76,0 @@ */ |
{ | ||
"name": "attach-ware", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "Middleware with configuration", | ||
@@ -20,3 +20,7 @@ "license": "MIT", | ||
}, | ||
"author": "Titus Wormer <tituswormer@gmail.com>", | ||
"bugs": "https://github.com/wooorm/attach-ware/issues", | ||
"author": "Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)", | ||
"contributors": [ | ||
"Titus Wormer <tituswormer@gmail.com> (http://wooorm.com)" | ||
], | ||
"files": [ | ||
@@ -26,33 +30,29 @@ "index.js" | ||
"devDependencies": { | ||
"browserify": "^11.0.0", | ||
"eslint": "^0.24.0", | ||
"browserify": "^13.0.0", | ||
"eslint": "^1.0.0", | ||
"esmangle": "^1.0.0", | ||
"istanbul": "^0.3.0", | ||
"jscs": "^1.0.0", | ||
"istanbul": "^0.4.0", | ||
"jscs": "^2.0.0", | ||
"jscs-jsdoc": "^1.0.0", | ||
"mdast": "^0.27.1", | ||
"mdast-comment-config": "^0.1.2", | ||
"mdast-github": "^0.3.0", | ||
"mdast-lint": "^0.4.0", | ||
"mdast-man": "^0.4.0", | ||
"mdast-toc": "^0.5.0", | ||
"mdast-validate-links": "^0.3.0", | ||
"mocha": "^2.0.0", | ||
"remark": "^4.0.0-alpha.4", | ||
"remark-comment-config": "^3.0.0-alpha.1", | ||
"remark-github": "^4.0.1", | ||
"remark-lint": "^2.0.0", | ||
"remark-toc": "^3.0.0-alpha.2", | ||
"remark-validate-links": "^2.0.2", | ||
"tape": "^4.4.0", | ||
"ware": "^1.3.0" | ||
}, | ||
"scripts": { | ||
"test-api": "mocha --check-leaks test.js", | ||
"test-coveralls": "istanbul cover _mocha --report lcovonly -- --check-leaks test.js", | ||
"test-coverage": "istanbul cover _mocha -- -- test.js", | ||
"test-travis": "npm run test-coveralls", | ||
"test": "npm run test-api", | ||
"build-md": "remark . --quiet --frail", | ||
"build-bundle": "browserify index.js -s AttachWare > attach-ware.js", | ||
"build-mangle": "esmangle attach-ware.js > attach-ware.min.js", | ||
"build": "npm run build-md && npm run build-bundle && npm run build-mangle", | ||
"lint-api": "eslint .", | ||
"lint-style": "jscs --reporter inline .", | ||
"lint": "npm run lint-api && npm run lint-style", | ||
"make": "npm run lint && npm run test-coverage", | ||
"build-md": "mdast . --quiet", | ||
"build-bundle": "browserify index.js -s AttachWare > attach-ware.js", | ||
"postbuild-bundle": "esmangle attach-ware.js > attach-ware.min.js", | ||
"build": "npm run build-md && npm run build-bundle" | ||
"test-api": "node test.js", | ||
"test-coverage": "istanbul cover test.js", | ||
"test": "npm run build && npm run lint && npm run test-coverage" | ||
} | ||
} |
@@ -1,2 +0,2 @@ | ||
# attach-ware [![Build Status](https://img.shields.io/travis/wooorm/attach-ware.svg)](https://travis-ci.org/wooorm/attach-ware) [![Coverage Status](https://img.shields.io/codecov/c/github/wooorm/attach-ware.svg)](https://codecov.io/github/wooorm/attach-ware) | ||
# attach-ware [![Build Status][travis-badge]][travis] [![Coverage Status][codecov-badge]][codecov] | ||
@@ -7,3 +7,3 @@ Middleware with configuration. | ||
[npm](https://docs.npmjs.com/cli/install): | ||
[npm][npm-install]: | ||
@@ -14,6 +14,4 @@ ```bash | ||
**attach-ware** is also available for [bower](http://bower.io/#install-packages), | ||
[component](https://github.com/componentjs/component), and [duo](http://duojs.org/#getting-started), | ||
and as an AMD, CommonJS, and globals module, [uncompressed](attach-ware.js) and | ||
[compressed](attach-ware.min.js). | ||
**attach-ware** is also available as an AMD, CommonJS, and globals | ||
module, [uncompressed and compressed][releases]. | ||
@@ -66,24 +64,29 @@ ## Usage | ||
> **Note**: first create a new constructor (later called `AttachWare`) | ||
> by passing `ware` to the by this module exposed function. This | ||
> enables ware-like libraries to be used too. | ||
### `AttachWare = attachWare(Ware)` | ||
### new AttachWare() | ||
Create a new `AttachWare` based on the given middleware constructor. | ||
Create configurable middleware. Works just like [`ware()`](https://github.com/segmentio/ware#ware-1). | ||
**Parameters**: | ||
### AttachWare#use(attach, input...) | ||
* `Ware` ([`Ware`][ware]). | ||
Invokes `attach` with either `attachWare.context` or `attachWare`, | ||
and all `input`. | ||
**Returns**: `Function`. | ||
### `AttachWare()` | ||
Create configurable middleware. Works just like the given | ||
[`Ware`][ware]. | ||
### `AttachWare#use(attach[, input...])` | ||
Invokes `attach` with [`context`][context] and all `input`. | ||
If `attach` returns another function (`fn`, which can be synchronous, | ||
asynchronous, or a generator function), that function is [added to the | ||
middleware](https://github.com/segmentio/ware#usefn), and will be invoked when | ||
[`run()`](https://github.com/segmentio/ware#runinput-callback) is invoked | ||
like normal middleware. | ||
middleware][ware-use], and will be invoked when [`run()`][ware-run] is | ||
invoked like normal middleware. | ||
### AttachWare#context | ||
### `AttachWare#context` | ||
The first argument for `attach`ers. When this is falsey, `attachWare` | ||
The first argument for `attach`ers. When this is falsey, the instance | ||
itself is used. | ||
@@ -93,2 +96,28 @@ | ||
[MIT](LICENSE) © [Titus Wormer](http://wooorm.com) | ||
[MIT][license] © [Titus Wormer][author] | ||
<!-- Definitions --> | ||
[travis-badge]: https://img.shields.io/travis/wooorm/attach-ware.svg | ||
[travis]: https://travis-ci.org/wooorm/attach-ware | ||
[codecov-badge]: https://img.shields.io/codecov/c/github/wooorm/attach-ware.svg | ||
[codecov]: https://codecov.io/github/wooorm/attach-ware | ||
[npm-install]: https://docs.npmjs.com/cli/install | ||
[releases]: https://github.com/wooorm/attach-ware/releases | ||
[license]: LICENSE | ||
[author]: http://wooorm.com | ||
[ware]: https://github.com/segmentio/ware#ware-1 | ||
[ware-use]: https://github.com/segmentio/ware#usefn | ||
[ware-run]: https://github.com/segmentio/ware#runinput-callback | ||
[context]: #attachwarecontext |
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
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
8687
14
125
120