Edgar
Edgar

Reputation: 6856

Is it possible to configure the node.js console to be visible in the browser

I am a front-end developer.I'm learning node.js now.it's unusual for me to see console in Terminal.Is it possible to configure so that the console is visible in Chrome ?.

Upvotes: 2

Views: 1135

Answers (1)

Isac Moura
Isac Moura

Reputation: 6928

Yes, you can use node inspector module or if your Node Version is v6.3.0+ you already have this functionallity:

Using --inspect command from Node v6.30.0+ :

  1. Run your JS file with: node --inspect YOUR_FILE_NAME.js
  2. Go to about:inspect in Chrome.
  3. Then in "Devices" click on "Open dedicated DevTools for Node"
  4. Now you have your Chrome Dev Tools integrated with your Node application.

Using Node Inspector module:

  1. Install the module globally: $ npm install -g node-inspector
  2. Start the module with: node-debug YOUR_FILE_NAME.js

Fonts: Debugging Node.js with Chrome DevTools
Node Inspector documentation

Upvotes: 3

Related Questions