GoogleChromeLabs / ndb
- понедельник, 23 июля 2018 г. в 00:15:57
JavaScript
ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools
ndb is an improved debugging experience for Node.js, enabled by Chrome DevTools
npm install -g ndb
Compatibility: ndb requires Node >=8.0.0. It works best with Node >=10.
Installation: ndb depends on Puppeteer which downloads a recent version of Chromium (~170MB Mac, ~280MB Linux, ~280MB Win).
Windows users: Installation may fail on Windows during compilation the native dependencies. The following command may help: npm install --g --production windows-build-tools
You can start debugging your Node.js application using one of the following ways:
ndb
instead of the node
commandndb server.js
# Alternatively, you can prepend `ndb`
ndb node server.js
ndb
in front of any other binary# If you use some other binary, just prepend `ndb`
## npm run unit
ndb npm run unit
# Debug any globally installed package
## mocha
ndb mocha
# To use a local binary, use `npx` and prepend before it
ndb npx mocha
ndb
as a standalone application
package.json
, e.g. unit tests# cd to your project folder (with a package.json)
ndb .
# In Sources panel > "NPM Scripts" sidebar, click the selected "Run" button
ndb
has some powerful features exclusively for Node.js:
_stream_wrap.js
, async_hooks.js
, fs.js
) This behaviour may be changed by "Blackbox anything outside working dir" setting.In addition, you can use all the DevTools functionality that you've used in typical Node debugging:
Check out contributing guide to get an overview of ndb development.
ndb
In early 2011, @smtlaissezfaire released the first serious debugger for Node.js, under the ndb
package name. It's still preserved at github.com/smtlaissezfaire/ndb. We thank Scott for generously donating the package name.