| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 2273971 commit 688f563
1 file changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -221,8 +221,10 @@ a separate process. | |||
| 221 | 221 | context. The primary use case is to get access to the V8 debug object: | |
| 222 | 222 | ||
| 223 | 223 | ```js | |
| 224 | + const vm = require('vm'); | ||
| 224 | 225 | const Debug = vm.runInDebugContext('Debug'); | |
| 225 | - Debug.scripts().forEach((script) => { console.log(script.name); }); | ||
| 226 | + console.log(Debug.findScript(process.emit).name); // 'events.js' | ||
| 227 | + console.log(Debug.findScript(process.exit).name); // 'internal/process.js' | ||
| 226 | 228 | ``` | |
| 227 | 229 | ||
| 228 | 230 | Note that the debug context and object are intrinsically tied to V8's debugger | |
| Back | FazBrowse Home | New Git URL |
0 commit comments