Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

is-touch-device

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-touch-device

Is the current JS environment a touch device?

  • 1.0.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
309K
decreased by-8.61%
Maintainers
3
Weekly downloads
 
Created

What is is-touch-device?

The is-touch-device npm package is a simple utility to detect if the current device supports touch events. This can be useful for tailoring user experiences based on whether the user is on a touch-enabled device or not.

What are is-touch-device's main functionalities?

Detect if the device is touch-enabled

This feature allows you to check if the current device supports touch events. The code sample demonstrates how to use the is-touch-device package to log a message indicating whether the device is touch-enabled.

const isTouchDevice = require('is-touch-device');

if (isTouchDevice()) {
  console.log('This is a touch device');
} else {
  console.log('This is not a touch device');
}

Other packages similar to is-touch-device

Keywords

FAQs

Package last updated on 18 Jun 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc