How to debug a Node.js app that take input from the command line?
NickName:znat Ask DateTime:2017-01-05T03:38:16

How to debug a Node.js app that take input from the command line?

I am working on a node.js chat app that takes input from the stdin and sends output to stdout. Using it requires access to the console.

The problem is that launching the app in debug mode blocks the console. How can I debug (inspect objects when breakpoints are reached) while having access to stdin in the console?

Copyright Notice:Content Author:「znat」,Reproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/41471946/how-to-debug-a-node-js-app-that-take-input-from-the-command-line

More about “How to debug a Node.js app that take input from the command line?” related questions

How to debug a Node.js app that take input from the command line?

I am working on a node.js chat app that takes input from the stdin and sends output to stdout. Using it requires access to the console. The problem is that launching the app in debug mode blocks ...

Show Detail

How to use pm2 with a nodejs app that uses readline for taking command line input?

I have a Node.js app that uses the node's native readline to be able to take command-line inputs. When launching the app with pm2, the command-line input is unavailable. Any ideas how to solve this...

Show Detail

How to emit an event from command line on running node.js app

I'm new to node.js and trying to solve the specifc task. To do so I need to know, how to trigger an event from command line. Let's say I have a function in node.js app, that I want to be runned every

Show Detail

how can we take input line by line in command line argument in java

I want to write a command-line argument program in java where the input one on each line rather than spaces. this is how I want to take input as command line argument like 1 then the next input w...

Show Detail

Take in escaped input in Ruby command line app

I'm writing a Ruby command line application in which the user has to enter a "format string" (much like Date.strptime/strftime's strings). I tried taking them in as arguments to the command, eg &...

Show Detail

user input of array in node.js through command line

I am writing code for sudoku solver. I am a beginner in javascript. How to take input of array from the user through the node.js. I have to take input like below in node.js using the command line. ...

Show Detail

Node.js - success from command line but error from vscode

I've just upgraded node from v0.10.* to v4.7.7 and I have an es6 code in my node.js app: class Myclass { } and when typing from command line: node --debug-brk=6648 --nolazy --harmony bin/www Ap...

Show Detail

Setting a debug function from the command line in Clojure

I have a namespace like this: (ns foo.core) (def ^:dynamic *debug-fn* "A function taking arguments [bar baz]" nil) (defn bar-info [bar _] (println bar)) (defn baz-info [_ baz]

Show Detail

How to you configure Selenium Webdriver to take in command line options with Node.js?

I have the following resources, but I'm not sure how to interpret them for this particular goal (this and this). I'm using Selenium WebDriver through Node.js, and so far, all my tests work as I wis...

Show Detail

How to take two consecutive input with the readline module of node.js?

I am creating a program to take input of two numbers from the command line and then showing there sum in node.js. I am using readline module to take stdin. Below is my code. const readline = requi...

Show Detail