Index of every page on this site: llms.txt
All skills
jasnell avatar

/node-diagnostics

@5f83e6c
Run it yourself

Instrumentation, context propagation and profiling added since Node.js 24. Use to instrument a library for APM or OpenTelemetry, propagate request context across async calls, profile one section of code (CPU or heap), capture a heap profile before an out-of-memory crash, find leaked objects, or set a conditional logpoint without editing code. Covers diagnostics_channel boundedChannel and TracingChannel (Stable), built-in channels, AsyncLocalStorage withScope/defaultValue, v8.startCpuProfile/startHeapProfile, setHeapProfileNearHeapLimit, queryObjects, node inspect --probe (--cond, --max-hit) and inspector Network/DOMStorage. Node.js 24+, some 26+.

Use this Skill: https://skilld.dev/gh/jasnell/node-skills/node-diagnostics

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

rulesinspector.md

≈607 tokens on demand. Your agent reads this file only when SKILL.md points to it.

Inspector: Network and DOMStorage events

Source: doc/api/inspector.md, doc/api/cli.md at nodejs/node ab476eccd03. The "Integration with DevTools" section is Stability 1.1. Verified by examples/network-inspection.mjs and examples/storage-inspection.mjs.

Network (--experimental-network-inspection, Stability 1; flag since v22.6.0, v20.18.0)

With the flag, built-in http/fetch traffic is reported to an attached CDP client (DevTools or an in-process inspector.Session after Network.enable) as Network.requestWillBeSent → Network.responseReceived → Network.loadingFinished. Verified on loopback with fetch.

Manual broadcasters, for custom transports. Each is a no-op without the flag (no throw):

Method Versions
inspector.Network.requestWillBeSent/responseReceived/loadingFinished v22.6.0, v20.18.0
inspector.Network.loadingFailed v22.7.0, v20.18.0
inspector.Network.dataReceived (buffers for Network.getResponseBody) v24.2.0, v22.17.0
inspector.Network.dataSent (enables Network.getRequestPostData) v24.3.0, v22.18.0
inspector.Network.webSocketCreated/webSocketHandshakeResponseReceived/webSocketClosed v24.7.0

inspector.NetworkResources.put(url, content) (v24.5.0, v22.19.0, Stability 1.1, flag --experimental-inspector-network-resource) pre-registers content for CDP Network.loadNetworkResource, for example a source map referenced by URL. This was not verified here.

DOMStorage (--experimental-storage-inspection, v25.5.0, v24.16.0, Stability 1.1)

  • Without the flag, DOMStorage.enable fails with "'DOMStorage.enable' wasn't found".
  • With the flag, built-in localStorage/sessionStorage changes emit DOMStorage.domStorageItemAdded, domStorageItemUpdated, domStorageItemRemoved, and domStorageItemsCleared automatically. The storageId is { securityOrigin: '', storageKey, isLocalStorage }. For local storage, storageKey is the --localstorage-file URL.
  • On v24, Web Storage itself also needs --experimental-webstorage. It is on by default from v25.0.0.
  • Manual broadcasters for custom stores: inspector.DOMStorage.domStorageItemAdded({ storageId, key, newValue }), domStorageItemRemoved({ storageId, key }), domStorageItemUpdated({ storageId, key, oldValue, newValue }), domStorageItemsCleared({ storageId }), registerStorage({ isLocalStorage, storageMap }).

Source: SKILL.md on GitHub

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

No alerts5d3 checks · Risk SAFE
  • Gen Agent Trust Hub5d

    This skill provides technical documentation and examples for Node.js diagnostics and profiling features (v24+). It covers instrumentation, context propagation, and debugging utilities like TracingChannel and AsyncLocalStorage. No security risks were identified.

  • Socket5d

    No alerts

  • Snyk5d

    Risk: LOW · No issues

Signed by skilld at 5f83e6c. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 5 days ago.

Activeupdated last week

README badge

README badge for jasnell/node-skills/node-diagnostics