v8-debug
Provides extending API for node internal debugger protocol (based on v8 debugger protocol)
This is a part of node-inspector.
Installation
npm install v8-debug
API
registerCommand(name, callback)
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;
registerEvent(eventName)
This is a shortcut for:
debug;
execCommand(commandName, attributes)
Calls debug processor command like 'lookup'.
attributes
will be passed to registerCommand.callback
as request.attributes
.
attributes
needs to be valid JSON object.
debug; debug;
emitEvent(eventName, attributes)
This is a semantic alias for execCommand
debug;
commandToEvent(request, response)
response
object has a different structure for commands and events.
By default registerCommand.callback
receives command's response.
This is a small converter.
debug; debug;
Use debug.registerEvent
instead of this.
runInDebugContext(script)
(alias get
)
Evaluates string or function (will be stringifyed) in debug context.
var MakeMirror = debug;var mirror = ;
getFromFrame(index, value)
Tries to receive a value
from targeted frame scopes
{ //... ;} { // There is no info about `options` object var options = debug;}
enableWebkitProtocol()
Enables experimental usage of WebKit protocol
registerAgentCommand(command, parameters, callback)
Experimental method for registering WebKit protocol handlers
Usage
Simple console.log checking
var debug = ; debug; consolelog = { return { debug; return fn; }} consolelog;
For more experience see protocol documentation