This is how to retrieve environment variables in the Node.js programming language. Retrieving and changing environment variables on the system is one of the most frequently used implementations in programming, so itโs useful to know how to do it.

Environment variables defined as follows:
export NODE_RC_FILE="${PGDIR}/node/noderc.js"
You can get the absolute path as follows:
process.env.NODE_RC_FILE
By the way,
To make it a relative path:
var path = require('path');
path.relative( __dirname , process.env.NODE_RC_FILE );
To further load it as an external module:
var noderc = require( path.relative( __dirname , process.env.NODE_RC_FILE ) );