Skip to content

Commit feec2c3

Browse files
committed
docs(pmdb): add instructions about pmdb to README
1 parent 078cb13 commit feec2c3

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

README.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -350,9 +350,34 @@ exports['today'] = date.today()
350350
## CommonJS (require)
351351
If you are having trouble with the CommonJS require function, set environment variable `DEBUG='ctx-module*'` and you can see the filenames it tries to laod.
352352

353+
## pmdb
354+
355+
PythonMonkey has a built-in gdb-like JavaScript command-line debugger called **pmdb**, which would be automatically triggered on `debugger;` statements and uncaught exceptions.
356+
357+
To enable **pmdb**, simply call `from pythonmonkey.lib import pmdb; pmdb.enable()` before doing anything on PythonMonkey.
358+
359+
```py
360+
import pythonmonkey as pm
361+
from pythonmonkey.lib import pmdb
362+
363+
pmdb.enable()
364+
365+
pm.eval("...")
366+
```
367+
368+
Run `help` command in **pmdb** to see available commands.
369+
370+
```console
371+
(pmdb) > help
372+
List of commands:
373+
...
374+
...
375+
```
376+
353377
## pmjs
354378
- there is a `.help` menu in the REPL
355379
- there is a `--help` command-line option
380+
- the `--inspect` option enables **pmdb**, a gdb-like JavaScript command-line debugger
356381
- the `-r` option can be used to load a module before your program or the REPL runs
357382
- the `-e` option can be used evaluate code -- e.g. define global variables -- before your program or the REPL runs
358383
- The REPL can evaluate Python expressions, storing them in variables named `$1`, `$2`, etc.

0 commit comments

Comments
 (0)