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

@mattiamarchesini/touch-ts

v1.1.3

Published

Super light TypeScript library for handling touch events and gestures in web applications, focussed on industrial HDMI displays.

Readme

Touch Screen TS

A super light TypeScript library for handling touch events and gestures in web applications, focussed on industrial HDMI displays.

Quick start

You can use it in any web page:

Install the module

npm install @mattiamarchesini/touch-ts

Just use it

  • Import the TouchScreen class
  • Instantiate it once, it will handle scrolling automatically, and you can also use it all around the app

Initialization

Create a new instance:

import { TouchScreen } from '@mattiamarchesini/touch-ts';

/**
 * @description Creates a new instance of the class handling touch events on the screen.
 * @param {string | null} attribute
 * @param {TouchTypes} type
 * @param {boolean} preventEvents
 * @param {TouchTypes} continuous
 * @param {number} minimum
 * @param {number} sensibility
 * @param {number} iterationLimit
 * @param {boolean} isTouch
 * @return {TouchScreen} New instance of this class.
 */
const touchScreen = new TouchScreen();

Where parameters are, in order:

  • attribute: Name of the attribute used to detect if an element is scrollable (true) or not (false). IMPORTANT: if null this feature will be replaced by a more complex detection based on the element's scrollability, but this will impact performances negatively. If undefined, 'tss' will be used. You can also use a class or id selector by starting the string with "." or "#" respectively. Remember: if an attribute is specified, it must be added to all elements that should be handled by this class. Default: 'tss'.
  • type: Scrolling type, defines if should handle vertical, horizontal or both scrolls. Default: TouchTypes.BOTH.
  • preventEvents: (Optional) Defines which type of events should be prevented during the scroll. If true all events will be prevented (used to prevent a click/touchend event to trigger and perform operations when the scroll ends over a reactive item). Default: false.
  • continuous: Defines if elements should continue scrolling after the user stops interacting with the screen when the movement had enough speed (true), or not (false). Default: true.
  • minimum: Minimum amount of pixels that should be scrolled to consider a movement continuos (moving after scroll have scroll ends). Default: 25.
  • sensibility: Sensibility of the touch movements, higher values means greater movements. IMPORTANT: if this parameter is differet from 1 the page will not follow the finger/mouse exactly, but the movements will be amplified (or reduced) accordingly. Default: 1.
  • iterationLimit: Limits the number of iterations to find a scrollable element when a touch start or mouse down event is triggered. Default: 50.
  • isTouch: Defines if should handle touch events (true) or click events (false). If not defined will be detected from browser's data. Default: detected from browser's data.

Technical details

Performance

This library is built with performance in mind, using efficient algorithms to handle touch events and gestures with minimal latency and no unnecessary events firing.

The bundle size is super light, but it could still be improved since the current version is built to be compatible with older browsers, if you need a lighter version for modern browsers only, please open an issue or a PR.

Framework agnostic

This library is framework agnostic, so you can use it with any framework you like (React, Vue, Angular, Svelte, etc.) or even with plain JavaScript/TypeScript.

Demo - Quick start

This repo comes with a fully working demo in /demo/index.html, to see it run:

npm install
npm run demo

And open http://127.0.0.1:5173/demo/ in your browser.

Author

License

This project is licensed under the Attribution License (MIT-Style). You are free to use and modify the code, would be really appreciated if you give credit to the original author.

© 2026 Mattia Marchesini