# Pipeline tap operator \`|:\`

**URL:** <https://es.discourse.group/t/pipeline-tap-operator/792>\
**Category:** 💡 Ideas\
**Tags:** proposal\
**Created:** [May 17, 2021, 4:15pm UTC](https://es.discourse.group/t/pipeline-tap-operator/792 "2021-05-17T16:15:31Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![kaizhu256](https://yyz2.discourse-cdn.com/free1/user_avatar/es.discourse.group/kaizhu256/32/342_2.png) [@kaizhu256](https://es.discourse.group/u/kaizhu256)\
**Post date:** [May 17, 2021, 4:51pm UTC](https://es.discourse.group/t/pipeline-tap-operator/792/2 "2021-05-17T16:51:10Z")

</div>

ux-wise, you can achieve the same with a helper-function `debugInline` (used in this [real-world example](https://github.com/kaizhu256/node-utility2/blob/905e5a85ad0996128499310892b9d9470c180ed0/lib.utility2.js#L29));

inline-debugging becomes trivial as follows:

```bash
#!/bin/sh

node -e '
// this inline-debugger can be safely copy-pasted into any script
// init debugInline
if (!globalThis.debugInline) {
    let consoleError;
    consoleError = console.error;
    globalThis.debugInline = function (...argList) {
    /*
     * this function will both print <argList> to stderr and
     * return <argList>[0]
     */
        consoleError("\n\ndebugInline");
        consoleError(...argList);
        consoleError("\n");
        return argList[0];
    };
}

function randInt(min, max) {
    // return Math.floor(
    // min +
    // Math.random() * (max - min)
    // );
    return Math.floor(
        debugInline( min, "min" ) +
        debugInline( Math.random() * (max - min), "random*scale ")
    );
}
randInt(0, 10);
'

# stderr:
#
#
# debugInline
# 0 min
#
#
#
#
# debugInline
# 0.9995644826073868 random*scale
#
#

```

---

_[View the full topic](https://es.discourse.group/t/pipeline-tap-operator/792)._
