Open In App

Node.js process.stderr Property

Last Updated : 12 Oct, 2021
Improve
Improve
Like Article
Like
Save
Share
Report

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

 


Like Article
Suggest improvement
Previous
Next
Share your thoughts in the comments

Similar Reads