मुख्य सामग्री पर जाएँ
Skillpedia
API और सर्वर (backend)12k · #11570

node-inspect-debugger

यह क्या करती है

यह स्किल एजेंट को बिल्ट-इन debugger और संबंधित टूल से Node.js प्रोग्राम में बग ढूँढना सिखाती है। यह उन डेवलपर्स के लिए है जो प्रोग्राम अटकने, flaky tests या मेमोरी समस्याओं जैसी मुश्किल समस्याओं से जूझ रहे हैं।

कब इस्तेमाल करें

  • ✓जब Node.js प्रोग्राम अटकता है या अजीब व्यवहार करता है और कारण साफ़ नहीं है।
  • ✓जब कोई test कभी पास और कभी फ़ेल होता है और आपको ठीक उस बिंदु पर रुकना है जहाँ वह विफल होता है।
  • ✓जब आपको Node.js ऐप में धीमे या लीक होते हिस्से के लिए मेमोरी snapshot या CPU profile चाहिए।

Skill का लिंक

https://github.com/EKKOLearnAI/ekko-studio/blob/main/packages/ekko-agent/skills/node-inspect-debugger/SKILL.md

इसे कॉपी करके अपने AI (Claude, ChatGPT या Cursor) में पेस्ट करें और निर्देशों का पालन करने को कहें।

कैसे इस्तेमाल करें

सबसे आसान तरीका: मैसेज कॉपी करके अपने AI में पेस्ट करें। वह skill पढ़कर निर्देशों का पालन करेगा।

पेस्ट करने के लिए तैयार मैसेज

इस skill से मेरी मदद करो: https://github.com/EKKOLearnAI/ekko-studio/blob/main/packages/ekko-agent/skills/node-inspect-debugger/SKILL.md इस लिंक की SKILL.md फ़ाइल पढ़ो और मेरे काम में उसके निर्देशों का पालन करो।
क्या आप चाहते हैं कि आपका AI ऐसी skills खुद ढूँढे?मुफ़्त Skillpedia MCP इंस्टॉल करें: बस एक लाइन, और हर काम से पहले यह 15,000+ skills में खोजता है।1 मिनट में इंस्टॉल करें →

AI से क्या माँगें: उदाहरण

“मेरी Node.js स्क्रिप्ट कभी-कभी अटक जाती है। मुझे सही लाइन पर रोककर कारण ढूँढने में मदद कीजिए।”

हर हफ़्ते 5 नई skills, 1 मिनट में पढ़ें।

यह कैसे काम करती है

एजेंट Node के बिल्ट-इन inspector से प्रोग्राम शुरू करता है, breakpoints सेट करता है और हर रुकने पर मान जाँचता है। स्क्रिप्ट वाली जाँचों के लिए वह स्थानीय पोर्ट से inspector से जुड़ भी सकता है।

तकनीकी सामग्री (मूल SKILL.md)

लेखक का मूल टेक्स्ट, अंग्रेज़ी में, सीधे GitHub से।

Node Inspect Debugger

Use when Node.js debugging requires hidden locals, async hangs, flaky tests, child processes, startup races, memory analysis, or CPU profiling.

Default to node inspect first. Use Chrome DevTools Protocol only for scripted breakpoints, automated state capture, heap snapshots, or CPU profiles.

Quick start

node inspect path/to/script.js
node --inspect-brk --import tsx path/to/script.ts
kill -SIGUSR1 <pid>
node inspect -p <pid>
curl -s http://127.0.0.1:9229/json/list | jq

For a test runner such as Vitest, debug one file with one worker and avoid worker pools while stepping.

Debugger REPL

  • Continue and step: cont, next, step, out, pause.
  • Breakpoints: sb('file.js', 42), sb(42), sb('functionName'), breakpoints, cb('file.js', 42).
  • Inspect: bt, list(8), watch('expr'), exec expr.
  • Current scope: enter repl, evaluate locals, then press Ctrl+C to exit REPL mode.
  • Exit safely: use cont before quitting if the process should keep running; otherwise use kill.

Safe setup

  • Prefer 127.0.0.1 inspector binds. Do not expose --inspect=0.0.0.0 unless the network is isolated.
  • Use --enable-source-maps when TypeScript source breakpoints need it.
  • NODE_OPTIONS=--inspect-brk can propagate the inspector to child processes, but each process needs a unique port.
  • For a long-lived service, confirm the PID and /json/list target before attaching.

Programmatic CDP

Install temporary tooling outside the project unless it is already a dependency:

mkdir -p /tmp/cdp-tools
npm --prefix /tmp/cdp-tools install chrome-remote-interface
NODE_PATH=/tmp/cdp-tools/node_modules node /tmp/cdp-debug.cjs

Minimal driver:

const CDP = require("chrome-remote-interface");

(async () => {
  const client = await CDP({ port: 9229 });
  const { Debugger, Runtime } = client;

  Debugger.paused(async ({ callFrames, reason }) => {
    const top = callFrames[0];
    console.log("paused", reason, top.url, top.location.lineNumber + 1);
    const { result } = await Debugger.evaluateOnCallFrame({
      callFrameId: top.callFrameId,
      expression: "JSON.stringify({ pid: process.pid })",
    });
    console.log(result.value ?? result.description);
    await Debugger.resume();
  });

  await Runtime.enable();
  await Debugger.enable();
  await Debugger.setBreakpointByUrl({ urlRegex: ".*target\\.js$", lineNumber: 41 });
  await Runtime.runIfWaitingForDebugger();
})();

Profiles

  • CPU: enable Profiler, start, wait, stop, write a .cpuprofile, then open it in Chrome DevTools.
  • Heap: enable HeapProfiler, collect addHeapSnapshotChunk, call takeHeapSnapshot, then write a .heapsnapshot.

Pitfalls

  • --inspect does not pause; use --inspect-brk when startup code matters.
  • Port 9229 is the default; use --inspect=0 or a unique port for parallel targets.
  • If a breakpoint misses, confirm the path, source maps, and whether execution already passed the line.
  • A process that appears frozen after detach may still be paused in the debugger.
अक्सर पूछे जाने वाले सवाल

क्या debugger को नेटवर्क पर खुला छोड़ना सुरक्षित है?

स्किल सुझाती है कि inspector को 127.0.0.1 से बाँधें और उसे सभी नेटवर्क पतों पर खुला न छोड़ें।

क्या यह TypeScript के साथ काम करता है?

हाँ। source maps के साथ breakpoints TypeScript सोर्स पर जा सकते हैं।

क्या यह child processes को डिबग कर सकता है?

हाँ, लेकिन हर प्रोसेस को अपना अलग पोर्ट चाहिए।

जानकारी

लेखक का मूल विवरण

Debug Node.js with node inspect, inspector attach, breakpoints, Chrome DevTools Protocol, heap snapshots, and CPU profiles.

repo: EKKOLearnAI/ekko-studio

लोकप्रियता

GitHub स्टार
12k
रैंकिंग में स्थान
#11570
लाइसेंस
—
अपडेट की गई
2/11/2026

क्या यह skill काम की है?

0

लॉग इन करें वोट करने के लिए।

कमेंट

  • …

इस repository की और skills

1password

12k

यह आपके एजेंट को 1Password CLI से कमांड और कॉन्फ़िग फ़ाइलों के लिए सीक्रेट लेने में मदद करती है, बिना उन्हें चैट, लॉग या सेव फ़ाइलों में दिखाए।

कोडिंगसिक्योरिटी

apple-notes

12k

यह आपके एजेंट को Mac पर memo कमांड लाइन टूल से Apple Notes बनाने, खोजने, पढ़ने, बदलने, ले जाने या मिटाने में मदद करती है।

प्रोडक्टिविटीटास्क और प्रोजेक्ट

apple-reminders

12k

यह आपके एजेंट को Mac पर remindctl टूल से Apple Reminders और रिमाइंडर लिस्ट देखने, बनाने, बदलने, पूरा करने या मिटाने में मदद करती है।

प्रोडक्टिविटीटास्क और प्रोजेक्ट

document-to-action-items

12k

यह आपके एजेंट को दस्तावेज़, मीटिंग ट्रांस्क्रिप्ट या नोट्स से कार्यों, ज़िम्मेदारों, समय-सीमाओं और फ़ैसलों की साफ़ तालिका बनाने में मदद करती है।

प्रोडक्टिविटीटास्क और प्रोजेक्ट

मिलती-जुलती skills