I am currently delving into learning typescript and I am in need of assistance in setting up debugger support in VS code. I have a simple TS app that functions as a standalone application, printing "Hello World" to the console when data is entered. How can I provide console input once the application is launched? I have set a breakpoint at line 6 where console.log is located, causing the execution to halt there upon launch. However, my goal is to inspect the console.log at line 4 while providing runtime console input.
Index.ts:
class Startup {
public static main(): number {
process.stdin.on("data",(buffer) => {
console.log("Hello World);
});
console.log("Test breakpoint");
return 0;
}
}
Startup.main();
Launch.json {
"version": "0.2.0",
"configurations": [
{
"type": "node",
"request": "launch",
"name": "Launch Program",
"skipFiles": [
"<node_internals>/**"
],
"preLaunchTask": "tsc: build - src/tsconfig.json",
"program": "${workspaceFolder}/src/index.ts",
"outFiles": ["${workspaceFolder}/dist/**/*.js"]
}
]
}