Node.js process.stderr Property
The process.stderr is an inbuilt application programming interface of class Process within process module which is used to returns a stream connected to stderr.
Syntax:
const process.stderr
Parameters: This api takes no argument as a parameter.
Return Value: This api returns a stream connected to stderr.
Example 1:
Filename: index.js
Javascript
// Node.js program to demonstrate the // Process.stderr // Importing process module const process = require( 'process' ); // Getting the stream // by using process.stderr const stream = process.stderr // Display the result console.log(stream.rows) |
Run the index.js file using the following command:
node index.js
Output:
16
Example 2:
Filename: index.js
Javascript
// Node.js program to demonstrate the // Process.stderr // Importing process module const process = require( 'process' ); // Display the result console.log(process.stderr.columns) |
Run the index.js file using the following command:
node index.js
Output:
147
Reference: https://nodejs.org/dist/latest-v16.x/docs/api/process.html#process_process_stderr
Please Login to comment...