### Debugging Node scripts
```bash
node --inspect-brk example.js
```
## Monitor Events
Pass an element and a series of events to `monitorEvents` to get a console log when the event happens:
```js
// Monitor any clicks within the window
monitorEvents(window, 'click')
```
```js
// Monitor for keyup and keydown events on the body
monitorEvents(document.body, ['keyup', 'keydown'])
```
You can pass an array of events to listen for multiple events. The logged `event` represents the same event you'd see if you manually called `addEventListener`.
## Monitor Function Calls
The `monitor` method allows you to listen for calls on a specific function:
```js
// Define a sample function
function myFn() { }
// Monitor it
monitor(myFn)
// Usage 1: Basic call
myFn() //➞ function myFn called
// Usage 2: Arguments
myFn(1) //➞ function myFn called with arguments: 1
```
#### More info
[Some website](https://test.com)
___
**Tags**: