From 1cae3d817cb75c4f3f1bc8701cbc9a95198dff48 Mon Sep 17 00:00:00 2001 From: Sven Slootweg Date: Tue, 23 Apr 2019 23:04:58 +0200 Subject: [PATCH] Add documentation, fix initial version --- README.md | 22 ++++++++++++++++++++++ package.json | 2 +- 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..9af685c --- /dev/null +++ b/README.md @@ -0,0 +1,22 @@ +# @ppstreams/propagate-abort + +A simple abort handler for ppstreams that just passes on an incoming abort notification to the source stream. + +## Example: + +```js +"use strict"; + +const propagateAbort = require("@ppstreams/propagate-abort"); + +module.exports = function makeStream() { + return { + description: `pass-through stream`, + read: (source) => { + /* This example stream just passes through the upstream value */ + return source.read(); + }, + abort: propagateAbort + } +}; +``` \ No newline at end of file diff --git a/package.json b/package.json index 95c5892..eb021ec 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@ppstreams/propagate-abort", - "version": "1.0.0", + "version": "0.1.0", "main": "index.js", "repository": "git@git.cryto.net:joepie91/ppstreams-propagate-abort.git", "author": "Sven Slootweg ",