How can I utilize
process.cwd()
within an Angular2 Component using TypeScript? What needs to be imported?
When used in the constructor like so:
console.log("Current working directory: ", process.cwd());
an error is displayed:
ORIGINAL EXCEPTION: ReferenceError: process is not defined
ORIGINAL STACKTRACE:
ReferenceError: process is not defined
Despite being able to use process.cwd() and __dirname directly in my JavaScript files, it's perplexing why it's not working here.
What needs to be imported? Could it be my reliance on nodeJS? Or perhaps incorrect assumptions that what works in node should work universally?