I am trying to dubug my app using debug package through nodemon package and I am facing this much trouble that my required output is hidden inside the messy irrelevant information as you can see
[nodemon] restarting due to changes...
nodemon bus emit: restart +25s
nodemon bus new listener: start (0) +0ms
nodemon bus new listener: start (0) +1ms
[nodemon] starting `node ./build/index.js`
nodemon fork C:\Windows\system32\cmd.exe /d /s /c node ./build/index.js +25s
nodemon bus emit: start +5ms
nodemon bus new listener: exit (2) +1ms
nodemon start watch on: *.* +2ms
[nodemon] restarting due to changes...
nodemon bus emit: restart +4ms
nodemon bus.emit(exit) via SIGUSR2 +218ms
nodemon bus emit: exit +215ms
[nodemon] starting `node ./build/index.js`
nodemon fork C:\Windows\system32\cmd.exe /d /s /c node ./build/index.js +5ms
nodemon bus emit: start +5ms
nodemon bus new listener: exit (1) +1ms
nodemon start watch on: *.* +2ms
app:normal it is normal debugger... +0ms
Listening on port: 3000
^CTerminate batch job (Y/N)? y
E:\Web Apps\RESTful API\express-demo>nodemon ./build/index.js
nodemon bus new listener: reset (0) +0ms
nodemon bus new listener: reset (0) +3ms
nodemon bus new listener: quit (0) +26ms
nodemon bus new listener: quit (0) +0ms
nodemon bus new listener: restart (0) +1ms
nodemon bus new listener: restart (0) +0ms
nodemon bus new listener: reset (2) +6ms
nodemon bus emit: reset +1ms
nodemon resetting watchers +0ms
nodemon reset +0ms
nodemon config: dirs [ 'E:\\Web Apps\\RESTful API\\express-demo' ] +0ms
[nodemon] 1.17.3
[nodemon] to restart at any time, enter `rs`
nodemon bus new listener: error (0) +106ms
nodemon bus new listener: error (0) +0ms
[nodemon] watching: *.*
[nodemon] starting `node ./build/index.js`
nodemon fork C:\Windows\system32\cmd.exe /d /s /c node ./build/index.js +0ms
nodemon bus new listener: exit (0) +12ms
nodemon bus new listener: exit (0) +1ms
nodemon start watch on: *.* +3ms
nodemon start watch on: E:\Web Apps\RESTful API\express-demo +119ms
nodemon ignored [ '**/.git/**',
'**/.nyc_output/**',
'**/.sass-cache/**',
'**/bower_components/**',
'**/coverage/**',
'**/node_modules/**',
re: /.*.*\/\.git\/.*.*|.*.*\/\.nyc_output\/.*.*|.*.*\/\.sass\-cache\/.*.*|.*.*\/bower_components\/.*.*|.*.*\/coverage\/.*.*|.*.*\/node_modules\/.*.*/ ] +1ms
nodemon watch is complete +147ms
app:normal it is normal debugger... +0ms
Listening on port: 3000
I am following these commands to debug my app
const debug = require('debug')('app:start')
debug('debugging the app... Yup!')
set DEBUG=app:start // inside terminal
nodemon index.js // inside terminal
Issue was very silly that I was running these two commands in different terminals that cause the problem
set DEBUG=app:start // inside terminal
nodemon index.js // inside terminal
be sure to run these commands in the same terminal. Hope this will save time for someone.