Optional
stdout: null | StdoutCallbackthe callback to be called when stdout is received
Optional
stderr: null | StdoutCallbackthe callback to be called when stderr is received
a StdoutRedirectGuard
instance. Keep this instance in scope to not lose the redirect.
Generated using TypeDoc
Enable stdout/stderr redirection.
Pass methods for the stdout and stderr output to be redirected to. These methods must accept an error as the first argument, although this will probably never be set and can be ignored. The second argument is the data that was redirected.
Setting any method to
null
orundefined
will disable the redirect for that method. This also allows you not set any handler which does not make any sense at all.Examples
Redirect all data to the js console
Redirect stdout to the js console
Redirect stderr to the js console
Redirect nothing to the js console (y tho)
This enables you to print nothing to nowhere.