
上QQ阅读APP看书,第一时间看更新
How to do it...
We simply have to set the NODE_DEBUG environment variable to one or more of the supported flags.
Let's start with the timer flag by running our app like so:
$ NODE_DEBUG=timer node index.js
This should show something like the following screenshot:

Core timer debug output
Let's try running the process again with both timer and http flags enabled:
$ NODE_DEBUG=timer,http node index.js
Now we need to trigger some HTTP operations to get any meaningful output, so let's send a request to the HTTP server using curl (or an alternative method, such as navigating to http://localhost:3000 in the browser):
$ curl http://localhost:3000
This should give output similar to the following screenshot:
