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

qway

v3.2.0

Published

create and handle the shortcuts for your website, very easily and effectively

Downloads

15

Readme

Qway.js

If shortcuts are mouses, then we are the mousetrap ;), but unlike MouseTrap our traps are bigger made for bears! You could trap normal shortcuts, combos, timed clicks and more coming up!

yeap that's me! @yousef_neji

CHANGELOG

Check changelog for more informations check

How to?

A very important note you should read

// USE
window.addEventListener('blur',function(){
  ... your callback
})
window.addEventListener('keydown',function(){
  ... your callback
})
window.addEventListener('keyup',function(){
  ... your callback
})
// DON'T
// window.onblur = function(){
//   ... your callback
// }
// window.onkeydown = function(){
//   ... your callback
// }
// window.onkeyup = function(){
//   ... your callback
// }

Our little library offers a nice collection of shortcuts:

  • shortcut(normal one) : Keys list separated by a + sign, once user click the sequence at the same time in the right order the callback get executed.

  • combo : a sequence of keys or a string in general separated by spaces similar to konami codes or games cheat code! once u typed it fast enough it executes the according callback.

  • timed : it's a sinlge key that once u click long enough it execute the attached callback, formed as key=>timeInMs example a=>2000.

Use

// ESM
import qway from "qway";

// CommonJs
const qway = require("qway");

Different shortcuts...

// ordinary shortcut
qway.bind("ctrl+alt+e", function () {
  console.log("hello world");
});
// a shortcut made of one key
qway.bind("t", function () {
  console.log("you click a key");
});
// combo
qway.bind("C O M B O", function () {
  console.log("true combo string!");
});
// combo with wild card
qway.bind("C O M * O", function () {
  console.log("you just used a wildcard");
});
// timed
qway.bind("a=>5000", function () {
  console.log("you click the A key for 5 seconds");
});

to unbind functions you...

qway.unbind("ctrl+alt+e", doHomeWork);

Check whether shortcut is reserved or not?

qway.reserved("ctrl+shift+d");

Replace a callback shortcut

qway.replace(closeApp, "ctrl+q");
let obj = qway.find("ctrl+q", closeApp);
// offering some extra functions
obj.unbind(); // unbind it
obj.get(); // Get the actual binding object
obj.index; // the index of the binding

~Interactive Mode~

Interactive mode or builder mode, is plugin that helps install a shortcut system ready to use in your app, it covers that part of assigning different shortcuts for different callbacks and change them over time.

let view = document.querySelector(".shortcuts-view");

qway
  .getFromUser(3, doHomeWork)
  .on("builder-change", function (e) {
    // occurs each time user clicks
    view.textContent = this.getString("+");
  })
  .on("builder-finish", function (e) {
    // occurs at the end once the shortcut lenght is fullfilled
    // the `true` will replace old shortcut if one is the same as this
    e.qway.approveFromUser(true); // approve
    // e.qway.declineFromUser(); // decline
  });

License

MIT