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

rhyke

v1.0.5

Published

![Img](./imgs/banner.png)

Readme

Img

中文文档

RhykeJS

Use morse code rhythm to awake something.

Why RhykeJS

When a front-end project on production, there are functions that still need to be invisible — unless certain conditions were reached. We can call these functions as “experiment function”. In many ways, people use a switch or some keyword to turn these functions on, and Rhyke use its own idea — using morse code gesture rhythm.

Img

How does it work?

Rhyke comes from “rhythm” and “awake”, which means “Awake something by rhythm”.

Inside RhykeJS, it listens mouse or touch events from the user defined area. By setting dashTime, it understands how long dose a click means “short signal” or “long signal”, and translates them into string . and - rhythm. Once the input rhythm matches the defined rhythm, something will be triggered.

https://codepen.io/jrainlau/pen/vWWypv

Install

yarn add rhyke

Usage

RhykeJS was built in umd, you can use it in different way:

  • ES6 modules
import Rhyke from 'rhyke'
  • CommonJS
const Rhyke = require('rhyke')
  • Web broswer
<script src="rhyke.js"></script>
<script>
    const Rhyke = window.Rhyke
</script>

The Rhyke instance is a constructor, you must use new operator to get initialization.

const rhyke = new Rhyke({
    el: 'body',
    rhythm: '...---...',
    matching (rhyArr) {
      // get user input rhythm array
      // such as [".", ".", "-", "-", "-", "."]
    },
    matched () {
      // trigger when rhythm matched
    },
    unmatched () {
      // trigger when rhythm unmatched
    },
    onTimeout () {
      // trigger when timeout
    }
})

Options

Rhyke accepts one object as its options:

defaultOptions = {
    // morse code listening area
    el: 'body',
    // define your rhythm, use "." as dots and "-" as dashes
    rhythm: '...',
    // how long from "dot" to "dash"
    dashTime: 400,
    // timeout for resetting input
    timeout: 2000,
    // RhykeJS uses mouse event in default; once the page was in mobile mode,
    // you should set `tabEvent` to `true`, then RhykeJS would use touch event in replace.
    tabEvent: false,
    // get user input rhythm array
    matching: () => {},
    // trigger when rhythm matched
    matched: () => {},
    // trigger when rhythm unmatched
    unmatched: () => {},
    // trigger when timeout
    onTimeout: () => {}
}

API

Once the matched or unmatched triggered, you may want to remove the event listener of the element you bind:

matched () {
  // something was awoke
  rhyke.removeListener()
}

License

MIT