0.0.20 • Published 10 years ago

v8-debug-protocol v0.0.20

Weekly downloads
2
License
MIT
Repository
github
Last release
10 years ago

V8 Debug Protocol

A simple v8 debug client implementation

Install

npm install --save v8-debug-protocol

How To Use

Create a client:

var Client = require('v8-debug-protocol')

// connect to remote port
var client = new Client(5858)

client.on('connect', function() {
  // nothing in this callback, just mark success
})

Send a continue request:

// after connected
client.continue(function(err, doneOrNot) {

});

// other continue
var step = 10
client.continue.in(step, function(err, doneOrNot) {})
client.continue.out(step, function(err, doneOrNot) {})
client.continue.next(step, function(err, doneOrNot) {})

Handle break event from remote debugger:

client.on('break', function(breakInfo) {
  console.log(breakInfo.script['some props'])
})

Get the scripts according to the script id

var ScriptManager = Client.ScriptManager;

client.on('break', function(breakInfo) {
  (new ScriptManager(client)).getScript(breakInfo.scripts.id, function(err, scriptContent) {
    console.log(scriptContent)
  })
})

Manage BreakPoints

list

var BreakPointManger = Client.BreakPointManger;

client.on('connect', function() {
  var bm = new BreakPointManager(client);
  bm.list()
    .then(function(breakpoints) {
      // all the brks
    })
});

clear one

bm.list()
  .then(function(breakpoints) {
    return breakpoints[0].clear()
  })

clear all

bm.clearAll()
  .then(fn, errFn)

create a new breakpoint

bm.createBreakpoint('script.js', 10, 'condition === true')
  .then(function(breakpoint) {
    breakpoint.should.be.instanceOf(BreakPoint) // :p
  })

Todo

..... don't know yet

0.0.21

10 years ago

0.0.20

10 years ago

0.0.19

10 years ago

0.0.18

10 years ago

0.0.17

10 years ago

0.0.16

10 years ago

0.0.14

10 years ago

0.0.13

10 years ago

0.0.12

10 years ago

0.0.11

10 years ago

0.0.9

10 years ago

0.0.8

10 years ago

0.0.7

10 years ago

0.0.6

10 years ago

0.0.5

10 years ago

0.0.4

10 years ago

0.0.3

10 years ago

0.0.2

10 years ago

0.0.1

10 years ago

0.0.0

10 years ago