Skip to content
Related Articles

Related Articles

Node.js process.stderr Property

View Discussion
Improve Article
Save Article
  • Last Updated : 12 Oct, 2021
View Discussion
Improve Article
Save Article

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

 

My Personal Notes arrow_drop_up
Recommended Articles
Page :

Start Your Coding Journey Now!