npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@zorilla/puppeteer-extra-plugin-repl

v1.0.1

Published

Start an interactive REPL in your puppeteer code.

Downloads

154

Readme

@zorilla/puppeteer-extra-plugin-repl

A plugin for puppeteer-extra.

Installation

npm install @zorilla/puppeteer-extra-plugin-repl

Purpose

Make quick puppeteer debugging and exploration fun with an interactive REPL.

  • Can interrupt your code at anytime to start an interactive REPL in your console.
  • Adds convenience .repl() methods to Page and Browser instances.
  • Supports inspecting arbitrary objects and instances.
  • Features tab auto-completion for the available object properties and a colorized prompt.

Kudos

REPL

repl

Quickstart

import puppeteer from '@zorilla/puppeteer-extra';
import replPlugin from '@zorilla/puppeteer-extra-plugin-repl';

puppeteer.use(replPlugin());

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://example.com');

// Start an interactive REPL here with the `page` instance.
await page.repl();
// Afterwards start REPL with the `browser` instance.
await browser.repl();

await browser.close();

Or with ESM:

import puppeteer from '@zorilla/puppeteer-extra';
import replPlugin from '@zorilla/puppeteer-extra-plugin-repl';

puppeteer.use(replPlugin());

puppeteer.launch({ headless: true }).then(async browser => {
  const page = await browser.newPage();
  await page.goto('https://example.com');

  // Start an interactive REPL here with the `page` instance.
  await page.repl();
  // Afterwards start REPL with the `browser` instance.
  await browser.repl();

  await browser.close();
});

In the REPL session (hit tab two times to see all available properties):

> page.url()
// => https://example.com
> page.click('a')
> page.url()
// => https://www.iana.org/domains/reserved
> page.content()
// => <!DOCTYPE html><html><head> ...
> page.goto('https://google.com')
> page.type('input', 'what is the answer to life the universe and everything')
> page.click('input[type=submit]')
> page.url()
// => https://www.google.com/search?source=hp&ei=u9oXW5HpO8a ...
> page.evaluate(() => document.querySelector('h3 a').textContent)
// => Question 42 (The Impossible Quiz) - The Impossible Quiz Wiki - Fandom
  • Type inspect to return the current object.
  • Type exit (or hit ctrl+c) to leave the repl.

API

Plugin

Extends: PuppeteerExtraPlugin

Interrupt your puppeteer code with an interactive REPL.

Features tab auto-completion for the given object properties and a colorized prompt.

Works with arbitrary objects and class instances, though Page & Browser make the most sense. :-)

Options

  • opts Object Options (optional, default {})
    • opts.addToPuppeteerClass boolean If a .repl() method should be attached to Puppeteer Page and Browser instances (default: true)

Example: Using without extending Puppeteer classes

import puppeteer from '@zorilla/puppeteer-extra';
import replPlugin from '@zorilla/puppeteer-extra-plugin-repl';

const repl = replPlugin({ addToPuppeteerClass: false });
puppeteer.use(repl);

const browser = await puppeteer.launch({ headless: true });
const page = await browser.newPage();
await page.goto('https://example.com');

// Start an interactive REPL here with the `page` instance.
await repl.repl(page);
// Afterwards start REPL with the `repl` instance itself. 🐴
await repl.repl(repl);

await browser.close();

repl(obj)

Create an interactive REPL for the provided object.

Uses an extended (colorized) readline interface under the hood. Will resolve the returned Promise when the readline interface is closed.

If opts.addToPuppeteerClass is true (default) then page.repl()/browser.repl() will point to this method, for convenience.

Can be used standalone as well, to inspect an arbitrary class instance or object.

Parameters:

  • obj Object An object or class instance to use in the repl (e.g. page, browser)

Returns: Promise<void>

Example:

import replPlugin from '@zorilla/puppeteer-extra-plugin-repl';

const repl = replPlugin();
await repl.repl(page); // or any object/class instance

Features

  • 🎨 Colorized prompt - Easy-to-read, color-coded interface
  • ⌨️ Tab completion - Auto-complete object properties and methods
  • 🔍 Inspect command - Return the current object for detailed inspection
  • 🚪 Exit command - Cleanly exit the REPL session
  • 🎯 Works with any object - Not limited to Puppeteer instances

Requirements

  • Node.js 20+
  • Puppeteer or Puppeteer-Core

License

MIT