WebStorm 2025.2 Help

Bun

WebStorm integrates with Bun, thus enabling you to run and debug JavaScript and TypeScript files with it as well as to use it as a package manager.

Before you start

Make sure the Bun bundled plugin is enabled in the Installed tab of the Settings | Plugins page as described in Install plugins.

Install Bun

Install Bun as described on the Bun official website.

Configure Bun

  1. Press Ctrl+Alt+S to open settings and then select Languages&Frameworks | Bun.

  2. Specify the path to the Bun executable file.

    The path to the Bun executable file defaults to your PATH environment variable, so if you leave the Bun field empty, the debugger attempts to detect the Bun executable file automatically.

Set Bun as the project package manager

  1. In the Settings dialog (Ctrl+Alt+S) , go to Languages & Frameworks | Node.js. The Node.js page opens.

  2. In the Package manager field, specify the Bun installation.

    • Select bun to use the system default installation.

      Select Bun as project package manager
    • To use a custom installation, click Select, and choose the installation folder from the list, learn more from Choose a project package manage

Run and debug with Bun

WebStorm supports the Debug Adapter Protocol (DAP), introducing the debugging experience.

With Bun, you can run and debug both JavaScript and TypeScript files.

Start running or debugging with Bun from the editor

If you have specified Bun as your default project package manager as described above, you can run and debug JavaScript and TypeScript files right from the editor. In this case, WebStorm creates a temporary run/debug configuration that you can save and use later.

  • To run a file, select Run '<file name>' from the context menu.

    Run a file with Bun from the editor
  • To debug a file, set the breakpoints where necessary and select Debug '<file name>' from the context menu.

    Start a Bun debugging session from the editor

Run and debug with Bun via a run/debug configuration

Debug with Bun run/debug configuration

Create a Bun run/debug configuration

  1. Go to Run | Edit Configurations. Alternatively, select Edit Configurations from the Run widget on the toolbar.

    Open the Edit Configurations dialog

    In the Edit Configurations dialog that opens, click the Add button (the Add button) on the toolbar and select Bun from the list.

    Create a run/debug configuration, select type Bun

    The Run/Debug Configuration: Bun dialog opens.

  2. In the File field, specify the path to the main file of the application that starts it. Specify the required JavaScript or TypeScript file or use a macro, for example, $FilePath$.

  3. Optionally:

    • In the Bun parameters field, specify Bun CLI options, for example, --watch or --hot, learn more from the Bun official website.

    • Select the Stop on Entry checkbox to have the application execution stop at the first line.

Run/debug configuration: Bun

Run your application

  1. Create a Bun run/debug configuration as described above.

  2. From the Run/Debug Configurations widget list on the toolbar, select the newly created Bun configuration and click the Run button next to it.

    Run application via a Bun run/debug configuration

Start debugging

  1. Set the breakpoints in the code where necessary.

  2. Create a Bun run/debug configuration as described above.

  3. From the Run widget list on the toolbar, select the newly created Bun configuration and click the Debug button next to it.

    Start a Bun debugging session with a run/debug configuration

    The Debug tool window opens.

  4. Perform the steps that will trigger the execution of the code with breakpoints and switch to WebStorm, where the controls of the Debug tool window are now enabled. Proceed with the debugging session — step through the breakpoints, switch between frames, change values on-the-fly, examine a suspended program, evaluate expressions, and set watches.

04 August 2025