# touch-events2

> Touch listener for browsers.

Latest version **1.0.0** (published 2017-06-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install touch-events2
pnpm add touch-events2
yarn add touch-events2
bun add touch-events2
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.0 |
| Published | 2017-06-18 |
| First published | 2017-06-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | apexearth@gmail.com |
| Maintainers | apexearth |
| Keywords | mobile, touch, events, input |

## Links

- npm: https://www.npmjs.com/package/touch-events2
- Repository: https://github.com/apexearth/touch-events2
- Homepage: https://github.com/apexearth/touch-events2#readme
- Issues: https://github.com/apexearth/touch-events2/issues
- npm.io page: https://npm.io/package/touch-events2

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 1.0.0 (latest) — 2017-06-18

## README

# touch-events2

![](https://travis-ci.org/apexearth/touch-events2.svg)
![](http://img.shields.io/npm/v/touch-events2.svg?style=flat)
![](http://img.shields.io/npm/dm/touch-events2.svg?style=flat)
![](http://img.shields.io/npm/l/touch-events2.svg?style=flat)

Provides touch events to developers using Node.js to develop for browsers.
 
## Usage

[![NPM](https://nodei.co/npm/touch-events2.png)](https://nodei.co/npm/touch-events2/)

### `listener = touchevents([target], [events])`

## Examples

#### Basic Usage

    const touchevents = require('touch-events2') // Also at window.touchevents.

    // Default target is:  document.body
    // Default events are: ["touchstart", "touchend", "touchmove"]
    var touch = touchevents() 
    
    touch.on("touchstart", function(event) {
        console.log(event)
    })

#### Custom  Target

    var touch = window.touchevents(document)

#### Custom Event List

    var touch = window.touchevents(['touchcancel'])

#### Custom Target & Event List

    var touch = window.touchevents(document, ['touchcancel'])
    
## Tests

- Mocha
   - Test functionality in Node.js
- Karma
   - Using browserify, test functionality in browsers
- User Testing
   - [grunt user-test](Gruntfile.js) is set to build, serve, and open [test/index.html](test/index.html)

---
_Source: https://npm.io/package/touch-events2 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
