| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
| Name | Name | Last commit date | ||
|---|---|---|---|---|
English | 简体中文
As you can see, the node program opened with the --inspect option does not support network tags because it does not proxy user requests. Node network devtools is designed to address this issue by allowing you to debug requests made by nodejs using the network tab of Chrome devtools, making the debugging process equivalent to a web crawler experience in the browser.
Node v22.6.0 experimentally supports network debugging. This library supports use before node v22.6.0, but the specific supported versions are unknown.
# npm
npm install node-network-devtools -D
# or pnpm
pnpm add node-network-devtools -D
# or yarn
yarn add node-network-devtools -DJust add the following code to the entry file of your project.
import { register } from 'node-network-devtools'
process.env.NODE_ENV === 'development' && register()To stop debugging network requests and eliminate side effects, just use the return value of the register method for cleanup.
import { register } from 'node-network-devtools'
const unregister = register()
unregister()The register function accepts an optional RegisterOptions object to customize its behavior. For a complete list of available options and their detailed descriptions, please refer to the Options Documentation.
| Back | FazBrowse Home | New Git URL |