# How to run Node commands from the editor This guide shows how to install, format, lint, test and run your project without leaving Turbo JS. It assumes the editor is installed and you have a directory with a `package.json` in it. ## Get a starter file Start the editor **from the directory holding `package.json`**, then choose **JavaScript ▸ Create tools file** (`Alt-J`, then `C`). That writes `.turbo-js/tools.toml` with the commands a Node project runs most, and opens it. The first three: ```toml [[tool]] name = "~I~nstall" command = "npm install" output = "popup" [[tool]] name = "~F~ormat" command = "npx prettier --write ." output = "popup" [[tool]] name = "~L~int" command = "npx eslint ." output = "popup" ``` Each `[[tool]]` becomes one line of the **JavaScript** menu, in the order they appear — unless it names a `menu` of its own, which a later section covers. The file is read every time the menu opens, so an edit takes effect immediately. ## Run one `Alt-J`, then the letter between the tildes — `I` to install, `T` to test. **Test** opens a **popup** at once, which fills in as the command runs. Its title carries the command and, once it has ended, how it went: ``` ┌──────────────── node --test — ok ─────────────────┐ │ ✔ greets by name (1.204ms) │ │ ℹ tests 1 │ │ ℹ suites 0 │ │ ℹ pass 1 │ │ ℹ fail 0 │ │ │ │ [ Close ] │ └────────────────────────────────────────────────────┘ ``` | Key | Effect | | --- | --- | | `↑` `↓` `PgUp` `PgDn` `Home` `End` | Read through the output | | `Escape` | Close it — and **stop the command** if it is still running | | `Enter` | Close it | A command that succeeded silently — `npx prettier --write .` on a project already formatted — shows `(no output)` rather than a blank box, so you can tell it from one that has not started. **Run** asks first, because a Node project has no single entry point the editor could know: ``` ┌──────────────── Run ────────────────┐ │ script, e.g. main.js │ │ [ ] │ └─────────────────────────────────────┘ ``` Type `main.js` and press `Enter`. A terminal window opens and the script runs in it; when it ends the window stays, showing what it printed. Press `Ctrl-W` to close it. Run it again and the box remembers the name for the rest of the session. ## The rest of the menu | Item | What it runs | Where | | --- | --- | --- | | **Install** | `npm install` — the dependencies `package.json` names, into `node_modules/` | a popup | | **Format** | `npx prettier --write .` — Prettier over the whole project | a popup; the open files are re-read afterwards | | **Lint** | `npx eslint .` — ESLint over the whole project | a popup; ESLint 9 needs an `eslint.config.js` | | **Test** | `node --test` — Node's own runner over every `*.test.js`, `*.spec.js` and `test/**/*.js` | a popup | | **Run** | `node