# @ecpy/ndx

> extended node debugger server and client cli on v8 debugger protocol

Latest version **1.1.1** (published 2020-04-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install @ecpy/ndx
pnpm add @ecpy/ndx
yarn add @ecpy/ndx
bun add @ecpy/ndx
```

Provides the command `ndx`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.1 |
| Published | 2020-04-14 |
| First published | 2020-01-24 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Edward Yung |
| Maintainers | ecpy |

## Links

- npm: https://www.npmjs.com/package/@ecpy/ndx
- Repository: https://github.com/ecpy/ndx
- Homepage: https://github.com/ecpy/ndx#readme
- Issues: https://github.com/ecpy/ndx/issues
- npm.io page: https://npm.io/package/@ecpy/ndx

## Dependencies (4)

- [tsc](https://npm.io/package/tsc.md) ^1.20150623.0
- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [bluebird](https://npm.io/package/bluebird.md) ^3.7.2
- [commander](https://npm.io/package/commander.md) ^4.1.0

## Recent versions

- 1.1.1 (latest) — 2020-04-14
- 1.0.5 — 2020-02-04
- 1.0.4 — 2020-01-25
- 1.0.3 — 2020-01-25
- 1.0.2 — 2020-01-25
- 1.0.1 — 2020-01-25
- 1.0.0 — 2020-01-24

## README

# ndx
extended node debugger server and client cli on v8 debugger protocol

## features
- able to register watchers to automate the debugging process 
- ```Watcher#onDebugEvent``` interface returns inspector object based on [v8 debugger protocol](https://chromedevtools.github.io/devtools-protocol/v8)
- watcher enables to blackbox and stepover the custom or internal scripts when stepping and trace function calls and variables
- separated server executable and client cli makes debugging dockerized node app possible 

## pending works
- update the cli interface for more easier readability
- add typings
- update demo gif
- support <a href="https://nestjs.com/">Nestjs</a> 

## demo
<img src="https://github.com/ecpy/ndx/raw/master/demo/ndx.gif">

## install
```bash
yarn global add @ecpy/ndx

# help
npx @ecpy/ndx --help

# launch debug server
npx @ecpy/ndx -s -h localhost -p 3000 $APP 

# launch as debug cli client with watchers
npx @ecpy/ndx -c -h localhost -p 3000 -w $WATCHERS_FILE
```

## examples
- watcher samples are located at ${PACKAGE_ROOT}/watcher-samples

```bash
cd $PACKAGE_ROOT

# test server
./cli.js -s -h localhost -p 3000 ./app-sample 

```

```bash
# test client
./cli.js -c -h localhost -p 3000 -w ./watcher-samples/index.js

ndx> pause

ndx> next

# debug APIs
ndx> help
```

- watcher class structure
```js
class VariablesWatcher extends Watcher {
    onDebugEvent(inspector, domain, name, params, nextWatcher) {
        if (domain == 'Runtime') {
            this.log('I am watching runtime domain calls');
        }
        nextWatcher();
    }
}
```

## debug APIs
- protocol method calls are defined on the inspector object returned by ```Watcher#onDebugEvent``` interface, see [v8 debugger protocol](https://chromedevtools.github.io/devtools-protocol/v8)

## development
- parts of the debugger structure is referenced from [node-inspect](https://github.com/nodejs/node-inspect)  

<img src="https://github.com/ecpy/ndx/raw/master/structure.png" height="500">

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