From 5e60f67d42f8a72f6641fe2701cebcd9afafe9df Mon Sep 17 00:00:00 2001 From: matoruru Date: Sat, 20 Mar 2021 01:48:46 +0900 Subject: [PATCH 1/3] Add stdinIsTTY (#30) --- src/Node/Process.purs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Node/Process.purs b/src/Node/Process.purs index 39099d9..8589959 100644 --- a/src/Node/Process.purs +++ b/src/Node/Process.purs @@ -20,6 +20,7 @@ module Node.Process , stdin , stdout , stderr + , stdinIsTTY , stdoutIsTTY , stderrIsTTY , version @@ -151,6 +152,11 @@ stdout = process.stdout stderr :: Writable () stderr = process.stderr +-- | Check whether the standard input stream appears to be attached to a TTY. +-- | It is a good idea to check this before processing the input data from stdin. +stdinIsTTY :: Boolean +stdinIsTTY = process.stdin.isTTY + -- | Check whether the standard output stream appears to be attached to a TTY. -- | It is a good idea to check this before printing ANSI codes to stdout -- | (e.g. for coloured text in the terminal). From e96128551175e3dd0e62746406d83d2771bc97e8 Mon Sep 17 00:00:00 2001 From: matoruru Date: Sat, 20 Mar 2021 02:17:06 +0900 Subject: [PATCH 2/3] Updated changelog (#31) --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 62d1a9f..7a9aeb5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,8 @@ Breaking changes: New features: + - Added `stdinIsTTY` as the counterpart of `process.stdin.isTTY` (#31) + Bugfixes: Other improvements: From 42cf6a48f63a46ee6fd02b7c8cc9dddff69b0b61 Mon Sep 17 00:00:00 2001 From: Thomas Honeyman Date: Fri, 19 Mar 2021 11:19:04 -0700 Subject: [PATCH 3/3] Update CHANGELOG.md --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7a9aeb5..b66bd7f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ Breaking changes: New features: - - Added `stdinIsTTY` as the counterpart of `process.stdin.isTTY` (#31) + - Added `stdinIsTTY` as the counterpart of `process.stdin.isTTY` (#31 by @matoruru) Bugfixes: