
Security News
Meet Socket at Black Hat and DEF CON 2025 in Las Vegas
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Provides extending API for node internal debugger protocol (based on v8 debugger protocol)
This is a part of node-inspector.
npm install v8-debug
Registers new debug processor command, like lookup
.
callback
accepts two arguments - request and response.
You need to modify response.body
if you want to return something to caller.
debug.registerCommand('_lookup', function(request, response) {
var test = request.attributes;
//do someting here
//and modify response
response.body = {
test: test
};
});
This is a shortcut for:
debug.registerCommand('someEvent', debug.commandToEvent);
Calls debug processor command like 'lookup'.
attributes
will be passed to registerCommand.callback
as request.attributes
.
attributes
needs to be valid JSON object.
debug.registerCommand('_lookup', function(request, response) {
var test = request.attributes;
//do someting here
//and modify response
response.body = {
test: test
};
});
debug.execCommand('_lookup', { attr: 'test' });
This is a semantic alias for execCommand
debug.emitEvent('myEvent', { attr: 'test' });
response
object has a different structure for commands and events.
By default registerCommand.callback
receives command's response.
This is a small converter.
debug.registerCommand('someEvent1', function(request, response) {
debug.commandToEvent(request, response);
});
debug.registerCommand('someEvent2', debug.commandToEvent);
Use debug.registerEvent
instead of this.
(alias get
)
Evaluates string or function (will be stringifyed) in debug context.
var MakeMirror = debug.get('MakeMirror');
var mirror = MakeMirror({ test: 1 });
Tries to receive a value
from targeted frame scopes
function a(options) {
//...
b();
}
function b() {
// There is no info about `options` object
var options = debug.getFromFrame(1, 'options');
}
Enables experimental usage of WebKit protocol
Experimental method for registering WebKit protocol handlers
Simple console.log checking
var debug = require('v8-debug');
debug.registerEvent('console.log');
console.log = (function(fn) {
return function() {
debug.emitEvent('console.log', {message: arguments[0]} /*, userdata*/);
return fn.apply(console, arguments);
}
} (console.log));
For more experience see protocol documentation
FAQs
v8 debugger extending API
The npm package v8-debug receives a total of 543 weekly downloads. As such, v8-debug popularity was classified as not popular.
We found that v8-debug demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Meet Socket at Black Hat & DEF CON 2025 for 1:1s, insider security talks at Allegiant Stadium, and a private dinner with top minds in software supply chain security.
Security News
CAI is a new open source AI framework that automates penetration testing tasks like scanning and exploitation up to 3,600× faster than humans.
Security News
Deno 2.4 brings back bundling, improves dependency updates and telemetry, and makes the runtime more practical for real-world JavaScript projects.