Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

v8-debug

Package Overview
Dependencies
Maintainers
1
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

v8-debug

v8 debugger extending API

  • 0.4.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
773
decreased by-2.52%
Maintainers
1
Weekly downloads
 
Created
Source

Build Status Build status

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

CommandParamsTypeDescription
registerCommandRegister new debug processor command, like 'lookup'. (Alias register)
name{String}Name of command.
callback{Function}function(request, response) modify your response in this function.
registerEventRegister new debug processor event, like 'break'.
name{String}Name of command.
execCommandCall debug processor command like 'lookup'. (Alias command)
name{String}Name of command.
attributes{Object}Extra parameters, that passes as command arguments.
userdata{Object}Data than needs to be stored, but can't be serialised before call processor callback. (Not implemented now)
emitEventLike execCommand
commandToEventConvert command response object to default event object with same name
request{Object}Request object created by debugger
response{Object}Response object that needs to be converted
runInDebugContextEvaluate string or function (stringifyed) in debug context. (Alias get)
script{String/Function}*String or clear function that needs to be evaluated in debug context *

Usage

var debug = require('v8-debug');
var MakeMirror = debug.get('MakeMirror');

//register 'console' event in v8 debugger protocol
debug.registerEvent('console');
//Now debugger can emit new event 'console'

//register '_lookup' command in v8 debugger protocol
debug.registerCommand('_lookup', function(request, response) {
  //do someting here
  //and modify response
  response.body = {};
});

console.log = (function(fn) {
  return function() {
    //Call 'console' command. (Emit console event)
    debug.emitEvent('console', {message: arguments[0]} /*, userdata*/);
    return fn.apply(console, arguments);
  }
} (console.log));

For more experience see protocol documentation

Keywords

FAQs

Package last updated on 15 Feb 2015

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc