Skip to content

Latest commit

 

History

History
29 lines (20 loc) · 679 Bytes

isFIFO.md

File metadata and controls

29 lines (20 loc) · 679 Bytes

nodejsscriptDocs


nodejsscript / $ / isFIFO

Function: 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));

⚠️ On Windows it can throw an error (see #42)!

Parameters

stream_id: 0 | 1

Returns

boolean