Skip to content

Getting Started with Browserless Debugger for easy REPL

Posted on:November 22, 2023 at 12:00 AM

As a developer, one of the most useful tools for debugging JavaScript code is the browser console. The browserless debugger provides an interactive browser-based console that makes it easy to experiment with code right from the browser. In this article, I’ll explain how to use the browserless debugger for REPL (Read-Evaluate-Print-Loop).

What is REPL?

REPL stands for Read-Evaluate-Print-Loop. It allows you to interactively run JavaScript code by:

  1. Reading user input
  2. Evaluating the input
  3. Printing the result
  4. Looping and waiting for more input

This provides a fast feedback loop for experimenting with code and debugging errors. The browser console is essentially a REPL environment for JavaScript in the browser.

Using the Browserless Debugger

The browserless debugger provides a full browser environment and JavaScript console accessible through the browser. Here are two ways to start using it:

1. Browser-based Debugger

The easiest way is to use the online debugger:

2. Local Docker

For a faster experience, you can run the debugger locally using Docker:

docker run -p 3000:3000 browserless/chrome  

Once launched, you have full access to the Chrome browser and can run JavaScript code.

Using the REPL

In the debugger, the JavaScript console acts as the REPL environment. Here’s how you can use it:

The right panel shows the browser screen updating in real-time as you execute code.

Debugger Screenshot

The browserless debugger provides an excellent REPL environment for experimenting and debugging frontend code right from the browser. The instant feedback loop helps build code iteratively.