File tree 1 file changed +10
-1
lines changed
1 file changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -19,6 +19,7 @@ module Node.Process
19
19
, stdout
20
20
, stderr
21
21
, stdoutIsTTY
22
+ , stderrIsTTY
22
23
, version
23
24
) where
24
25
@@ -132,10 +133,18 @@ stdout = process.stdout
132
133
stderr :: forall eff . Writable () (console :: CONSOLE , err :: EXCEPTION | eff )
133
134
stderr = process.stderr
134
135
135
- -- | Check whether the process is being run inside a TTY context
136
+ -- | Check whether the standard output stream appears to be attached to a TTY.
137
+ -- | It is a good idea to check this before printing ANSI codes to stdout
138
+ -- | (e.g. for coloured text in the terminal).
136
139
stdoutIsTTY :: Boolean
137
140
stdoutIsTTY = process.stdout.isTTY
138
141
142
+ -- | Check whether the standard error stream appears to be attached to a TTY.
143
+ -- | It is a good idea to check this before printing ANSI codes to stderr
144
+ -- | (e.g. for coloured text in the terminal).
145
+ stderrIsTTY :: Boolean
146
+ stderrIsTTY = process.stderr.isTTY
147
+
139
148
-- | Get the Node.js version.
140
149
version :: String
141
150
version = process.version
You can’t perform that action at this time.
0 commit comments