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

automation_model

v1.0.522

Published

An automation infrastructure module to be use for generative AI automation projects.

Readme

Stable API Description

This API is built on top of Playwright to control browsers. The most common commands are:

  • click
  • clickType
  • verifyTextExistInPage

Parameters

  • selectors - An object that can contain the name of the element as well as multiple selectors (CSS, ARIA, etc.) used to locate the element.
  • world - Used as part of cucumber-js.
  • _params - An object that includes the original function parameters (used in dynamic selectors).
  • options - All actions playwright options are supported: "button", "clickCount", "delay", "modifiers", "force", "position", "trial", "timeout".
  • climb - After finding the element using the selectors, will climb the DOM.

Unless stated otherwise, the APIs will return an information object and will throw an error in case of failure.

Function List

async goto(url: string, world);
/* Use AI to identify an element and click on it */
async simpleClick(elementDescription, _params, options = {}, world);
async simpleClickType(elementDescription, value, _params, options = {}, world);
async click(selectors, _params, options = {}, world);
/* Return true/false */
async waitForElement(selectors, _params, options = {}, world);
async setCheck(selectors, checked = true, _params, options = {}, world);
async hover(selectors, _params, options = {}, world);
async selectOption(selectors, values, _params, options = {}, world);
async type(_value, _params, options = {}, world);
async setDateTime(selectors, value, format, enter = false, _params, options = {}, world);
/* Use to populate text fields */
async clickType(selectors, _value, enter = false, _params, options = {}, world);
/* Return the text */
async _getText(selectors, climb, _params, options = {}, info, world);
async containsText(selectors, text, climb, _params, options = {}, world);
setTestData(testData, world);
getTestData(world);
async verifyElementExistInPage(selectors, _params, options = {}, world);
async extractAttribute(selectors, attribute, variable, _params, options = {}, world);
async verifyAttribute(selectors, attribute, value, _params, options = {}, world);
async verifyPagePath(pathPart, options = {}, world);
async verifyTextExistInPage(text, options = {}, world);
async waitForTextToDisappear(text, options = {}, world);
async verifyTextRelatedToText(textAnchor, climb, textToVerify, options = {}, world);
async visualVerification(text, options = {}, world);
async waitForPageLoad(options = {}, world);
async closePage(options = {}, world);
saveTestDataAsGlobal(options, world);
async setViewportSize(width, height, options = {}, world);
async reloadPage(options = {}, world);
async conditionalWait(selectors, condition, timeout = 1000, _params = null, options = {}, world = null);
/* Return the ARIA snapshot as string */
async getAriaSnapshot();

Code Use Cases

Original Function

async function login_with_user_and_password(_username, _password) {
  const _params = { _username, _password };
  // Fill Username textbox with "_username"
  await context.web.clickType(elements["textbox_username"], _username, false, _params, null, this);
  // Fill Password textbox with "_password"
  await context.web.clickType(elements["textbox_password"], _password, false, _params, null, this);
  // Click on Login button
  await context.web.click(elements["button_login"], _params, null, this);
}

Example 1: Continue execution if step fails

async function login_with_user_and_password(_username, _password) {
  const _params = { _username, _password };
  try {
    await context.web.clickType(elements["textbox_username"], _username, false, _params, null, this);
    await context.web.clickType(elements["textbox_password"], _password, false, _params, null, this);
    await context.web.click(elements["button_login"], _params, null, this);
  } catch (error) {}
}

Example 2: Perform action only if "textbox_username" is found

async function login_with_user_and_password(_username, _password) {
  const _params = { _username, _password };
  if (await context.web.waitForElement(elements["textbox_username"], _params, { timeout: 4000 }, this)) {
    await context.web.clickType(elements["textbox_username"], _username, false, _params, null, this);
    await context.web.clickType(elements["textbox_password"], _password, false, _params, null, this);
    await context.web.click(elements["button_login"], _params, null, this);
  }
}

Example 3: Retry step if it fails

async function login_with_user_and_password(_username, _password) {
  const _params = { _username, _password };
  const maxRetry = 2;
  for (let i = 0; i < maxRetry; i++) {
    try {
      await context.web.clickType(elements["textbox_username"], _username, false, _params, null, this);
      await context.web.clickType(elements["textbox_password"], _password, false, _params, null, this);
      await context.web.click(elements["button_login"], _params, null, this);
      break;
    } catch (error) {
      if (i === maxRetry - 1) {
        throw error;
      }
    }
  }
}

Example 4: Set click timeout to 2 minutes

async function login_with_user_and_password(_username, _password) {
  const _params = { _username, _password };
  await context.web.clickType(elements["textbox_username"], _username, false, _params, { timeout: 120000 }, this);
  await context.web.clickType(elements["textbox_password"], _password, false, _params, { timeout: 120000 }, this);
  await context.web.click(elements["button_login"], _params, { timeout: 120000 }, this);
}

To use the playwright page object directly, use: context.web.page