3

i'm developing a terminal based app with Node, and i'm using the terminal as output of a Blessed.js visualization. So, i can't use the terminal to console.log thing for debug. Does node offer an alternative debug output? I'm using VSCode.

Thanks!

piLeoni
  • 131
  • 13

1 Answers1

2

In package.json add in scripts section:

 "scripts": {
    "debug": "node --nolazy --inspect-brk=9229 main.js"
  },

In vscode launch.json add:

{
    "version": "0.2.0",
    "configurations": [
        {
            "type": "node",
            "request": "attach",
            "name": "Attach",
            "port": 9229
        }
    ]
}

Now:

First run blessed app with npm run debug

In 2nd step run vscode debugger with F5

You will see both blessed app interface and debugger in vscode.

Works for me ;)

Bartek
  • 21
  • 2