If possible, do yourself a favor and test your code to make sure it works with NodeJS version 6.3 or greater.
Official supportarrow-up-right for Node.js debuggability landed in Node.js version 6.3 in May 2016.
Before v6.3: https://github.com/node-inspector/node-inspectorarrow-up-right
expose port 9229 if using docker
and start your code: node --inspect --debug-brk myCode.js
node --inspect --debug-brk myCode.js
it will output a url to connect with chrome://inspect/#devices, go ahead and copy/paste that URL into chrome
chrome://inspect/#devices
under the sourcestab, place breakpoints where ever you want ... then hit play to let the code run
sources
Your code starts in "paused" mode because of --debug-brk
--debug-brk
take a snapshot, then:
either, run requests against web server to cause load
or, simply let your one-time nodejs code run until it hits a breakpoint
take another snapshot
compare heap snapshots in chrome devtools
Last updated 7 years ago