nodejsscript • Docs
nodejsscript / $ / isFIFO
isFIFO(
stream_id
):boolean
Method to check whether script stdin/stdout (0/1) is a first-in-first-out (FIFO) pipe or not.
node pipes.js | … # — test by $.isFIFO(1)
… | node pipes.js # — test by $.isFIFO(0)
…more precisely:
import { stdin, stdout } from "node:process";
echo($.isFIFO(stdin.fd), $.isFIFO(stdout.fd));
• stream_id: 0
| 1
boolean