Open In App
Related Articles

Node.js process.stderr.fd Property

Improve Article
Improve
Save Article
Save
Like Article
Like

The process.stderr.fd is an inbuilt application programming interface of class Process within process module which is used to returns the value of underlying file descriptor of process.stderr.

Syntax:

const process.stderr.fd

Parameters: This api takes no argument as a parameter.

Return Value: This api returns the value of the underlying file descriptor of process.stderr.

 

Example 1: 

index.js




// Node.js program to demonstrate the  
// process.stderr.fd
  
// Importing process module
const process = require('process');
  
// Getting the value of file descriptor 
// by using process.stderr.fd
const value = process.stderr.fd
  
// Display the result
console.log(value)

Run the index.js file using the following command:

node index.js

Output:

2

Example 2:

index.js




// Node.js program to demonstrate the  
// process.stderr.fd
  
// Importing process module
const process = require('process');
  
// Updating file descriptor value
process.stderr.fd = 10
  
// Getting the value of file descriptor 
// by using process.stderr.fd
const value = process.stderr.fd
  
// Display the result
console.log(value)

Run the index.js file using the following command:

node index.js

Output:

10

Reference: https://nodejs.org/dist/latest-v16.x/docs/api/process.html#process_process_stderr_fd

Last Updated : 28 May, 2021
Like Article
Save Article
Similar Reads
Related Tutorials