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 🙏

© 2024 – Pkg Stats / Ryan Hefner

tap.js-tmp

v1.0.0

Published

`Tap` is a Javascript library for easy unified handling of user interactions such as mouse, touch and pointer events.

Downloads

6

Readme

TAP.JS

Tap is a Javascript library for easy unified handling of user interactions such as mouse, touch and pointer events.

  • No need to detect what kind of events are supported, Tap handles this for you
  • Small distribution size of 1Kb
  • Use fastest event types supported (majority of browsers has ~300ms delay between touch/pointer events and click). Every milisecond does really matter!

Installation

If you are using Bower:

bower install tap

Otherwise just download the library.

Include it anywhere in your html file (it does not matter where — in <head> or not):

<script src="bower_components/tap/dist/tap.min.js"></script>

Usage

Using Tap is super easy. Just handle the 'tap' event in a way you are familiar with:

document.getElementById('any-element').addEventListener('tap', function (e) {
    // All the magic happens here
});

With jQuery

$('#any-element').on('tap', function (e) {
    // All the magic happens here
});

With Zepto

$('#any-element').on('tap', function (e) {
    // All the magic happens here
});

With Dojo

var myButton = dojo.byId('any-element');
dojo.connect(myButton, 'tap', function(e){
    // All the magic happens here
});

With YUI

YUI().use('event', 'node', function (Y) {
    Y.one('#any-element').on('tap', function(e) {
        // All the magic happens here
    });
});

With ExtJS

Ext.get('any-element').on('tap', function (e) {
    // All the magic happens here
});

With Meteor

First, install Meteor package:

meteor add jimbog:tap

Then, the tap event is used just like any other event in Meteor, here is an example for an anchor element:

Template.MyTemplate.events({
    'tap a': function(evt, tmpl){
        evt.preventDefault();
        console.log('you tapped the link');
    }
})

With Angular

Just add the code below or dist/tap.angular.js to your project, and use ng-tap insted of ng-click. Do not forget add ngTap as a dependency.

angular.module('ngTap', []).directive('ngTap', function() {
    return function(scope, element, attrs) {
        element.bind('tap', function() {
            scope.$apply(attrs['ngTap'], element);
        });
    };
});

Browser Support

Tap was tested on the wide range of devices:

  • HTC T9295
  • iPhone 4, 5s
  • HTC Inspire 4G
  • Motorola Xoom
  • Nexus 4
  • Nexus 5
  • BlackBerry Bold 9800
  • Acer S7
  • Nokia Lumia 825
  • Nokia Lumia 800

And browsers:

  • Android Browser 2+
  • BlackBerry Browser 6+
  • Chrome 31+
  • Firefox for Android
  • Firefox 24+
  • IE 9+
  • Mobile Chrome
  • Mobile Safari 5+
  • Opera 12+
  • Opera Mini
  • Safari 5+

It doesn't mean that all other platforms and browsers (or older versions of them) are not supported.

LICENSE

Tap is distributed under MIT license. Enjoy!