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

ui-simulator

v0.0.6

Published

Simulate user interactions with minimal scripting.

Downloads

3

Readme

ui-simulator

Simulate user interactions with minimal scripting. Built on top of puppeteer, but gives you a standardized command structure for easy script authoring.

Install

npm install ui-simulator --save-dev

or

yarn add -D ui-simulator

Prerequisites

Usage

const puppeteer = require('puppeteer');
const actions = require('ui-simulator');

(async () => {
	const browser = await puppeteer.launch({ headless: false });
	const page = await browser.newPage();

	await actions(page, [
		{ navigateUrl: 'http://google.com/' },
		{ waitFor: 1000 },
		{ focus: 'input[name=q]' },
		{ type: 'puppeteer is awesome' },
		{ click: 'input[type=submit][name=btnK]' },
		{ waitFor: 1000 },
	]);

	await browser.close();
})();

Command Definitions

The command definition is a simple array of objects. Each object in the array should be interpreted as a single step or action.

In the usage example illustrated above, we are navigating to a website, waiting 1 second, setting the focus, etc. This allows you to succinctly define the user simulation and interaction with a web interface.

Commands

Each command is an object with a single key/value pair.

example: { [COMMAND_NAME]: [VALUE] },

a11y

Performs an accessibility analysis using the axe-core accessibility rules engine.

{ a11y: {
	callback: async (results) => {
		console.log('Hey these are results: ', results.violations.length);
	},
	config: {
		include: [['#my-selector']],
	},
}},

assert

Coming soon!

click

Simulates a mouse click on an element.

{ click: '#my-element' },

evaluate

Allows you to run your own javascript.

{ evaluate: async page => {
	await page.evaluate(() => alert('test!'));
	// do more cool stuff here...
}},

focus

Set the focus to the provided target

{ focus: '#my-element' },

hover

Simulate a hover on the provided target

{ hover: '#my-element' },

keyboardNavigateTo

Simulates keyboard navigation. This will continue to tab through the UI elements until it has reached the target.

{ keyboardNavigateTo: '#my-element' },

keypress

Simulates a keypress. Use this tool to help figure out keynames, if you need.

{ keypress: 'Enter' },

navigateUrl

Navigates to the specified URL.

{ navigateUrl: 'http://cool.site.com' },

screenshot

Coming soon!

select

Sets the value of the targeted select field.

{ select: {target: '#my-select', value: 'option1'} },

setValue

Sets the value of the targeted input field.

{ setValue: {target: '#my-field', value: 'hello world'} },

type

Simulates a user typing.

{ type: 'hello world!' },

waitFor

Pause the script for a given amount of time. Time is in milliseconds.

{ waitFor: 1000 },