touch-events2

1.0.0 • Public • Published

touch-events2

Provides touch events to developers using Node.js to develop for browsers.

Usage

NPM

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

Dependents (1)

Package Sidebar

Install

npm i touch-events2

Weekly Downloads

5

Version

1.0.0

License

MIT

Last publish

Collaborators

  • apexearth