demo.js
input.txt
output.txt
Step 1 - Go to Terminal Click on Configure Tasks
Step 2 - Select Create a tasks.json file from template and then Click on Others
Step 3 - Copy the Code given below and Paste it into tasks.json
{
"version": "2.0.0",
"tasks": [
{
"label": "Run JavaScript with Input/Output",
"type": "shell",
"command": "node",
"args": ["${file}", "<", "input.txt", ">", "output.txt"],
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
},
"options": {
"cwd": "${workspaceFolder}"
}
}
]
}