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

keyboarder

v0.0.3

Published

监听按键事件,支持 command option 等复合按键

Readme

introduction

网页也可以像 vim 编辑器一样的支持快捷键

keyboader 封装了对复杂按键的监听,从而让我们的网页事件更丰富

quick start

yarn add keyboader
import addKeyListener from 'keyboarder'

addKeyListener({
  a: () => alert('用户按下了 a 键'),
  abc: () => alert('用户顺序按下了 abc 键')
})

复杂按键配置

按键配置:

addKeyListener({
  a: () => {
    alert("a");
    // 由于有 ab 的存在,因此会延迟执行
  },
  ab: () => {
    alert("ab");
    // 没有后续待匹配的,则直接执行
  },
  // 复杂按键,用 | 分割
  "m-a|m-b": () => {
    // 全部复杂按键的
    alert("用户按住meta(即mac下的command), 并顺序按了 a、b");
  },
  "m-a|b": () => {
    // 首字母复杂按键的
    alert("用户按住meta,并按下a,之后松开meta,并按下 b");
  },
  "m-c-c|b": () => {
    // 多复杂按键的 按照 meta alt control shift 的顺序,如 m-a-c-s-v 表示按下了 meta、alt、control、shift 并按了 v 键。注:mac 下实际 alt(option) 用不上,因为会改变字符
    alert("用户按住 meta 和 control 键,并按下了 c,之后松开,并按下了 b");
  },
  "m-c-c|m-c-v": () => {
    // 全部多复杂按键
    alert("m-c-c|m-c-v");
  },
  "a|b", // 特殊规则:按过 cmd 之后,弹起,再输入 ab
  "|a", // 特殊规则:针对按过 meta 并弹起,再按 a
});

其他配置

addKeyListener(orders, 2000, command => {
  alert(`用户当前命令为: ${command}`)
})

2、3 参可选,一个是设置超时时间,默认 1500,一个设置回调,显示当前的命令

esc 键能清空之前的命令