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

hapticly

v0.1.1

Published

One call for a real haptic tap on the web. iOS and Android.

Readme

hapticly

One call for a real haptic tap on the web. haptic() detects the platform: the iOS system tap via the switch trick, and the Vibration API on Android.

Install

npm i hapticly

Quick start

The reliable way is to bind haptics to the element the user taps:

import haptic from "hapticly";

const button = document.querySelector("button");
haptic.attach(button);

On Android you can also fire it programmatically:

haptic();                         // a short tap
haptic([45, 50, 45]);             // a custom pattern
haptic(haptic.patterns.success);  // a named pattern

Why you attach on iOS

iOS gives the web no vibration API. The only thing it exposes is the system tap that plays when an <input switch> is toggled by a real finger touch. So on iOS haptics must be tied to the element the user actually touches. A tap fired purely from JavaScript is ignored. attach() overlays an invisible switch on your element to make this work.

What each platform can do

  • Android. Real durations and patterns through navigator.vibrate. Needs a secure context (https).
  • iOS. One fixed tap. Intensity, duration and patterns cannot be varied, so every haptic feels the same. It must come from a real touch, so use attach.
  • Desktop. No vibration hardware, so calls return false and do nothing.

API

  • haptic(pattern?) fire a tap. pattern is a duration in ms or an [on, off, ...] array. The pattern detail only applies on Android.
  • haptic.attach(el, pattern?) bind haptics to el. Returns a cleanup function. This is the recommended path for iOS.
  • haptic.isSupported() true if the device can produce feedback.
  • haptic.stop() cancel an ongoing Android vibration.
  • haptic.patterns named Android patterns: tap, success, warning, error.

Caveats

  • Must run inside a user gesture. Browsers block feedback on page load.
  • The iOS trick relies on undocumented behavior, so Apple can change it. Verified on Safari 17.4 and on iOS 26.6.1 (iPhone 17 Pro). Test on your target devices.

License

MIT