Open In App

Node.js process.stderr Property

Last Updated : 12 Oct, 2021
Summarize
Comments
Improve
Suggest changes
Share
Like Article
Like
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


 


Next Article

Similar Reads