EMACS JS DEBUGGING WITH INDIUM
- indium requires a config file to be setup
.indium.json - M-x indium-launch
The .indium.json file can contain as many configurations as needed, and mix any supported configuration types.
The currently supported type values are "chrome" and "node".
The root directory of the source files is by default set to the directory where this .indium.json file is placed, but it can be overridden with the root (or the webRoot alias) option:
BACK-END (node mode)
| program: | Nodejs program to start a new process. The --inspect flag will be added automatically. Expected type: string. |
|---|---|
| args: | Arguments passed to the program to debug. Expected type: string. |
| inspect-brk: | Whether Indium should break at the first statement (false by default). |
| host: | Host on which the Node inspector is listening (defaults to "localhost"). |
| port: | Port on which the Node inspector is listening (defaults to 9229). |
{
"configurations": [
{
"name": "11ty",
"type": "node",
"program": "node",
"args": "./node_modules/.bin/eleventy",
"inspect-brk": true
}
]
}
FRONT-END(chrome)
| host: | Host on which Chrome is running (defaults to "localhost"). |
|---|---|
| port: | Port on which Chrome is running (defaults to 9222). |
| url: | Url to open when running indium-launch. |
{
"configurations": [
{
"name": "Web project",
"type": "chrome",
"host": "127.0.0.1",
"url": "http://127.0.0.1/",
"port": 9222
}
]
}
Indium can be started in two modes:
- Connect:
M-x indium-connectConnect indium to a running runtime from one of the configurations in the.indium.jsonproject file. - Launch:
M-x indium-launchStart a JavaScript process (Chrome or NodeJS) as specified from the configurations in the.indium.jsonproject file.
NOTES:
snap chrome allows chromium cli call
Append
alias chromium="flatpak run org.chromium.Chromium"to your ~/.bashrc file
(setq indium-chrome-executable "chrome")