Is there a way to read environment variable address in Node.js?
For example :
var env_addr = env_memory_address(process.env.PATH);
console.log(env_addr); // output: 0xbf832ff
Is there a way to read environment variable address in Node.js?
For example :
var env_addr = env_memory_address(process.env.PATH);
console.log(env_addr); // output: 0xbf832ff
Is there a way to read environment variable address in Node.js?
No, not from plain Javascript. Javascript itself does not surface memory addresses in any way either in the browser or in the node.js execution environment.
You could probably write a node.js add-on in C++ and could then get a memory address, but even if you surfaced it back to Javascript in some Javascript data type, you couldn't do anything with it directly in Javascript (other than pass it to other C++ add-on code) and you'd probably have to put a string-ized version of the address in a Javascript string variable because there is no other Javascript data type that's a good match for a 64-bit memory address. Or, you could make your own "handle" that had the address in it and was surfaced back to Javascript as an object. But, either way you couldn't do anything with the memory address in Javascript.