Pre-requisites:
npm install
Then open two PowerShell windows.
First start in new Powershell window the test.js:
node .\test.js
Then in second window, observe that tsc is running:
Get-CIMInstance -ClassName Win32_Process | Where-Object {$_.CommandLine -like "*node.exe*tsc*"} | Select-Object ProcessID, CommandLine
ProcessID CommandLine
--------- -----------
23624 "C:\Copies\Node\\node.exe" "C:\Copies\Node\\node_modules\typescript\bin\tsc" --noEmit --watch
Then send Ctrl+C to first window and notice that test.js is killed.
Then try this again:
Get-CIMInstance -ClassName Win32_Process | Where-Object {$_.CommandLine -like "*node.exe*tsc*"} | Select-Object ProcessID, CommandLine
Notice that same process is still running, you should get:
ProcessID CommandLine
--------- -----------
23624 "C:\Copies\Node\\node.exe" "C:\Copies\Node\\node_modules\typescript\bin\tsc" --noEmit --watch
Now you must stop it forcefully:
Stop-Process 23624