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 🙏

© 2025 – Pkg Stats / Ryan Hefner

dooy

v0.2.1

Published

Tiny desktop automation tool to emulate keyboard and mouse events.

Downloads

7

Readme

dooy

dooy is a tiny desktop automation tool to emulate keyboard and mouse events.

dooy was born out of the need to emulate keyboard(and mouse) events in end to end testing scenarios. Since our current library stopped working in the latest macOS version, we were looking for a solution. That's were I found cliclick a "Command-line tool for emulating mouse and keyboard events". So I decided to write a little JavaScript wrapper around that tool.

Currently it only supports keyboard events on macOS. More features will be added as needed, maybe even another OS.

Installation

Install dooy with

npm install dooy

or

yarn install dooy

dooy expects cliclick to be installed on your system, it might be added as a binary one day, we'll see.

To install cliclick using homebrew just type brew install cliclick in your terminal. For other ways to install cliclick, see the cliclick's website.

Usage

import { press } from 'dooy'; // const press = require('dooy').press


press('cmd', 'q'); // quit app

API

The API strives to be simple, all the following commands are valid:

press('a'); // press key 'a'
press('abc'); // press keys 'a', 'b' and 'c'
press('cmd', 'c'); // press 'cmd' and 'c'
press('cmd,shift', 'arrow-up,arrow-down'); // press 'cmd'&'shift' and 'arrow-up'&'arrow-down'
press('cmd+c'); // press 'cmd' and 'c'

so the function press takes a comma seperated list of keys to press.

You can use any of the following 'special keys', besides the normal alphabet or numerical keys (or any other key with it's own symbol):

  • arrow-down
  • arrow-left
  • arrow-right
  • arrow-up
  • brightness-down
  • brightness-up
  • delete
  • end
  • enter
  • esc
  • f1
  • f2
  • f3
  • f4
  • f5
  • f6
  • f7
  • f8
  • f9
  • f10
  • f11
  • f12
  • f13
  • f14
  • f15
  • f16
  • fwd-delete
  • home
  • keys-light-down
  • keys-light-toggle
  • keys-light-up
  • mute
  • num-0
  • num-1
  • num-2
  • num-3
  • num-4
  • num-5
  • num-6
  • num-7
  • num-8
  • num-9
  • num-clear
  • num-divide
  • num-enter
  • num-equals
  • num-minus
  • num-multiply
  • num-plus
  • page-down
  • page-up
  • play-next
  • play-pause
  • play-previous
  • return
  • space
  • tab
  • volume-down
  • volume-up

You can also prepend a comma seperated list of modifier keys, it is also possible to prepend the modifier keys with a '+' (see last example).

Possible modifier are:

  • alt
  • cmd
  • ctrl
  • fn
  • shift

Since + is used to seperate modifier keys, it's a good idea to use num-plus if you want to press the plus sign. Also if you want to type any of the above 'special keys' e.g. you want to to type space, you can just add a comma like s,pace which would type 'space' as expected and not transform it to a ' '.

press() (and any other upcoming command) will returns a promise, so it is very useful in tests and you can chain it and do all the other nasty stuff you otherwise do with promises, e.g.:

press('cmd', 'c').then(()=> press('cmd', v))
  .catch((error) => console.log('catching the failure'));

or

await press('cmd', 'c');
await press('cmd', 'v');

Have fun!