# v8-debug-protocol

> v8 protocol client

Latest version **0.0.20** (published 2014-06-26) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install v8-debug-protocol
pnpm add v8-debug-protocol
yarn add v8-debug-protocol
bun add v8-debug-protocol
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 0.0.20 |
| Published | 2014-06-26 |
| First published | 2014-03-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Known vulnerabilities | 0 (+7 in 2 direct dependencies) |
| Install scripts | no |
| Author | kiddkai |
| Maintainers | kiddkai |

## Links

- npm: https://www.npmjs.com/package/v8-debug-protocol
- Repository: https://github.com/kiddkai/v8-debug-protocol
- Issues: https://github.com/kiddkai/v8-debug-protocol/issues
- npm.io page: https://npm.io/package/v8-debug-protocol

## Dependencies (3)

- [q](https://npm.io/package/q.md) ^1.0.1
- [debug](https://npm.io/package/debug.md) ^0.7.4
- [lodash](https://npm.io/package/lodash.md) ^2.4.1

## Recent versions

- 0.0.20 (latest) — 2014-06-26
- 0.0.19 — 2014-06-26
- 0.0.18 — 2014-06-26
- 0.0.17 — 2014-06-26
- 0.0.16 — 2014-06-06
- 0.0.14 — 2014-05-28
- 0.0.13 — 2014-05-27
- 0.0.12 — 2014-05-27
- 0.0.11 — 2014-05-16
- 0.0.9 — 2014-05-15
- 0.0.8 — 2014-05-14
- 0.0.7 — 2014-05-14
- 0.0.6 — 2014-05-14
- 0.0.5 — 2014-05-04
- 0.0.4 — 2014-05-02
- … 3 more at https://npm.io/package/v8-debug-protocol/versions

## README

V8 Debug Protocol
======================

A simple v8 debug client implementation

Install
----------------------

```bash
npm install --save v8-debug-protocol
```

How To Use
----------------------

Create a client:

```js
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:

```js
// 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:

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

Get the `scripts` according to the script `id`

```js
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`
```js

var BreakPointManger = Client.BreakPointManger;

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

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

`clear all`
```js
bm.clearAll()
  .then(fn, errFn)
```

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

Todo
--------------------

..... don't know yet

---
_Source: https://npm.io/package/v8-debug-protocol · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
