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
const process = require( 'process' );
const value = process.stderr.fd
console.log(value)
|
Run the index.js file using the following command:
node index.js
Output:
2
Example 2:
index.js
const process = require( 'process' );
process.stderr.fd = 10
const value = process.stderr.fd
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