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

@plutoxyz/automation-utils

v0.0.1

Published

A utility library for Playwright designed to make your Pluto automation scripts more resilient and easier to write.

Readme

@plutoxyz/automation-utils

A utility library for Playwright designed to make your Pluto automation scripts more resilient and easier to write.

The core of this library is a PlutoPage object, a wrapper around Playwright's Page. It's designed to prevent common "stale element" errors by dynamically targeting the currently active page in a browser context, rather than being tied to a specific page instance. This is especially useful for modern, complex web applications.

Installation

You can install the package using your favorite package manager:

npm install @plutoxyz/automation-utils

Getting Started

When writing a Pluto script, you get a browser context from the @plutoxyz/automation library. Instead of using a standard Playwright Page, you should immediately use the createPlutoPage function from this library to create a resilient page object that will make your script more robust.

Example

import { createSession } from "@plutoxyz/automation";
import { chromium } from "playwright-core";
import { createPlutoPage, PlutoPage } from "@plutoxyz/automation-utils";

// 1. Get the Pluto automation session
const session = await createSession();

// 2. Connect to the browser instance provided by the session
const browser = await chromium.connectOverCDP(await session.cdp());
const context = browser.contexts()[0];

// 3. Create a PlutoPage instead of a regular Playwright page
const page: PlutoPage = createPlutoPage(context);

// 4. Now, use 'page' for the rest of your script.
// It will always target the active page, making your script robust.
const locator = await page.loadAndGet(
  "https://some-website.com",
  page.getByText("Example Domain")
);

if (await page.exists(locator)) {
  console.log(`Found locator: ${await locator.textContent()}`);
} else {
  console.log("Locator not found");
}

// ... your automation logic here

await browser.close();
await session.close();

Additional Utilities

PlutoPage also comes with a few extra helper methods to simplify common automation tasks:

  • exists(locator, timeout?, interval?): Checks for the presence of an element without throwing an error if it's not found immediately. Returns true if the element exists, false otherwise.
  • waitFor(locator, timeout?): A more lenient waitFor that returns the Locator if found, or null if it times out, preventing script crashes.
  • waitForAnyNav(timeout?): Waits for any type of navigation event to complete (load, domcontentloaded, or networkidle).
  • loadAndGet(url, locator, waitUntil?, timeout?): A convenient method that navigates to a URL and waits for a specific locator to be present, returning the locator or null. Useful for detecting page load by waiting for a specific element to be present.

Development

To contribute, you can build the library and run a watcher for development.

  • npm run build: Compiles the TypeScript source code into JavaScript in the dist directory.
  • npm run dev: Starts a watcher that automatically recompiles the code whenever a file is changed.