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

show-key-press

v1.0.6

Published

A lightweight key press display tool that shows user keyboard inputs on screen in real-time. Perfect keyboard mapping support for both Mac and Windows systems.

Readme

show-key-press

NPM version NPM downloads codecov

A lightweight key press display tool that shows user keyboard inputs on screen in real-time. Perfect keyboard mapping support for both Mac and Windows systems.

Features

  • 🎯 Real-time key press display
  • 💡 Smart detection of key combinations
  • 🖥 Auto OS detection and adaptation
  • 🎨 Elegant visual effects
  • 🔧 Customizable container
  • 📦 Zero dependencies
  • 📱 ESModule support for modern development

Installation

npm install show-key-press

# or
yarn add show-key-press

# or
pnpm add show-key-press

Module Format

show-key-press is distributed as an ESModule package for modern development workflows:

// ESM
import { ShowKeyPress } from 'show-key-press';

Usage

import { ShowKeyPress } from 'show-key-press';

// Create instance
const keyPress = new ShowKeyPress();

// Initialize styles
keyPress.init();

// Start listening to key events
keyPress.start();

// Stop listening and cleanup
keyPress.destroy();

Options

interface ShowKeyPressOptions {
  // Specify OS type, auto-detect by default
  os?: 'mac' | 'win';
  
  // Custom container element, defaults to document.body
  el?: HTMLElement;
}

Basic Example

// Custom configuration
const keyPress = new ShowKeyPress({
  os: 'mac', // Force Mac key mapping
  el: document.querySelector('#my-container') // Custom display container
});

Vue Integration

<template>
  <div ref="keyContainer"></div>
</template>

<script>
import { ShowKeyPress } from 'show-key-press';
import { onMounted, onBeforeUnmount, ref } from 'vue';

export default {
  setup() {
    const keyContainer = ref(null);
    let keyPress;

    onMounted(() => {
      keyPress = new ShowKeyPress({
        el: keyContainer.value
      });
      keyPress.init();
      keyPress.start();
    });

    onBeforeUnmount(() => {
      keyPress?.destroy();
    });

    return {
      keyContainer
    };
  }
};
</script>

React Integration

import { useEffect, useRef } from 'react';
import { ShowKeyPress } from 'show-key-press';

function KeyPressDisplay() {
  const containerRef = useRef(null);
  
  useEffect(() => {
    const keyPress = new ShowKeyPress({
      el: containerRef.current
    });
    
    keyPress.init();
    keyPress.start();
    
    return () => {
      keyPress.destroy();
    };
  }, []);
  
  return <div ref={containerRef} />;
}

export default KeyPressDisplay;

API

init()

Initialize the required styles for key display.

start()

Start listening to keyboard events and display key presses.

destroy()

Stop listening to keyboard events and cleanup resources.

Style Customization

The component uses CSS selectors that you can override for customization:

/* Container style */
[data-keys] {
  /* Your custom styles */
}

/* Key style */
[data-keys] [data-key] {
  /* Your custom styles */
}

Browser Support

  • Chrome >= 49
  • Firefox >= 52
  • Safari >= 10
  • Edge >= 14

License

MIT

Contributing

Issues and Pull Requests are welcome!

Changelog

0.0.1-alpha.1

  • 🎉 Initial release
  • ✨ Basic key display functionality
  • 🔧 Mac/Win system adaptation