Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion doc/api/vm.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,8 +221,10 @@ a separate process.
context. The primary use case is to get access to the V8 debug object:

```js
const vm = require('vm');
const Debug = vm.runInDebugContext('Debug');
Debug.scripts().forEach((script) => { console.log(script.name); });
console.log(Debug.findScript(process.emit).name); // 'events.js'
console.log(Debug.findScript(process.exit).name); // 'internal/process.js'
```

Note that the debug context and object are intrinsically tied to V8's debugger
Expand Down