You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
24 lines
557 B
Markdown
24 lines
557 B
Markdown
5 years ago
|
# @ppstreams/propagate-peek
|
||
|
|
||
|
A simple peek handler for ppstreams that just passes on an incoming peek request to the direct upstream.
|
||
|
|
||
|
## Example:
|
||
|
|
||
|
```js
|
||
|
"use strict";
|
||
|
|
||
|
const propagateAbort = require("@ppstreams/propagate-abort");
|
||
|
const propagatePeek = require("@ppstreams/propagate-peek");
|
||
|
|
||
|
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,
|
||
|
peek: propagatePeek
|
||
|
}
|
||
|
};
|
||
|
```
|