Let's say I do node someCommand.js
. I want this command to change the directory of the terminal.
When I tried process.chdir(newDir)
, that just changes the directory in the context of the script - once the command exits, the terminal is still in the old directory.