Skip to content

Commit 52dd182

Browse files
committed
docs: try to explain the use case for this function
1 parent b891487 commit 52dd182

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

doc/api/os.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -520,6 +520,10 @@ added: REPLACEME
520520

521521
Returns the type of the file descriptor passed in, or `null` if the provided file descriptor
522522
is invalid.
523+
A common use case for this function is checking whether standard input is passed into your process,
524+
and if it is, if it can be consumed by the process. For example, on Unix systems, if the type is `TTY`, it means
525+
you can prompt the user for new data while the process is running, and if it's `FILE` or `PIPE`, it means there is data
526+
available, but you shouldn't try to prompt for more.
523527

524528
Currently, the following types for a file descriptor can be returned:
525529

0 commit comments

Comments
 (0)