Initial commit
commit
d0b5a86a86
@ -0,0 +1,2 @@
|
||||
node_modules
|
||||
yarn.lock
|
@ -0,0 +1,24 @@
|
||||
# @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
|
||||
}
|
||||
};
|
||||
```
|
@ -0,0 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
module.exports = function propagatePeek(source) {
|
||||
return source.peek();
|
||||
};
|
@ -0,0 +1,8 @@
|
||||
{
|
||||
"name": "@ppstreams/propagate-peek",
|
||||
"version": "0.1.0",
|
||||
"main": "index.js",
|
||||
"repository": "http://git.cryto.net/ppstreams/propagate-peek.git",
|
||||
"author": "Sven Slootweg <admin@cryto.net>",
|
||||
"license": "WTFPL OR CC0-1.0"
|
||||
}
|
Loading…
Reference in New Issue