Browse Source

Add documentation, fix initial version

Sven Slootweg 1 year ago
parent
commit
1cae3d817c
2 changed files with 23 additions and 1 deletions
  1. 22 0
      README.md
  2. 1 1
      package.json

+ 22 - 0
README.md

@ -0,0 +1,22 @@
1
# @ppstreams/propagate-abort
2
3
A simple abort handler for ppstreams that just passes on an incoming abort notification to the source stream.
4
5
## Example:
6
7
```js
8
"use strict";
9
10
const propagateAbort = require("@ppstreams/propagate-abort");
11
12
module.exports = function makeStream() {
13
	return {
14
		description: `pass-through stream`,
15
		read: (source) => {
16
			/* This example stream just passes through the upstream value */
17
			return source.read();
18
		},
19
		abort: propagateAbort
20
	}
21
};
22
```

+ 1 - 1
package.json

@ -1,6 +1,6 @@
1 1
{
2 2
  "name": "@ppstreams/propagate-abort",
3
  "version": "1.0.0",
3
  "version": "0.1.0",
4 4
  "main": "index.js",
5 5
  "repository": "git@git.cryto.net:joepie91/ppstreams-propagate-abort.git",
6 6
  "author": "Sven Slootweg <admin@cryto.net>",