The output line data (trimmed whitespace)
Optional boolean flag indicating if this is stderr output (true) or stdout output (false/undefined)
Promise
Basic usage:
const Echo = async (Data: string, IsError?: boolean): Promise<void> => { if (Level === "silent") { return; } console.log(Data);}; Copy
const Echo = async (Data: string, IsError?: boolean): Promise<void> => { if (Level === "silent") { return; } console.log(Data);};
Filtering by error level:
const ErrorOnlyEcho = async (Data: string, IsError?: boolean): Promise<void> => { if (IsError) { console.error(Data); }}; Copy
const ErrorOnlyEcho = async (Data: string, IsError?: boolean): Promise<void> => { if (IsError) { console.error(Data); }};
Silencing all output:
const SilentEcho = async (): Promise<void> => { // Do nothing - suppress all output}; Copy
const SilentEcho = async (): Promise<void> => { // Do nothing - suppress all output};
Param: Data
The output line data (trimmed whitespace)
Param: IsError
Optional boolean flag indicating if this is stderr output (true) or stdout output (false/undefined)
Returns
Promise
Example
Basic usage:
Example
Filtering by error level:
Example
Silencing all output: