Security News
Research
Data Theft Repackaged: A Case Study in Malicious Wrapper Packages on npm
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
is-touch-device
Advanced tools
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.
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');
}
The detect-touch package provides similar functionality to is-touch-device by allowing you to detect if the current device supports touch events. It offers a straightforward API for checking touch support, making it a good alternative.
The is-touch package is another alternative that helps in detecting touch capabilities of a device. It provides a simple method to determine if the device is touch-enabled, similar to is-touch-device.
FAQs
Is the current JS environment a touch device?
The npm package is-touch-device receives a total of 233,706 weekly downloads. As such, is-touch-device popularity was classified as popular.
We found that is-touch-device demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Research
The Socket Research Team breaks down a malicious wrapper package that uses obfuscation to harvest credentials and exfiltrate sensitive data.
Research
Security News
Attackers used a malicious npm package typosquatting a popular ESLint plugin to steal sensitive data, execute commands, and exploit developer systems.
Security News
The Ultralytics' PyPI Package was compromised four times in one weekend through GitHub Actions cache poisoning and failure to rotate previously compromised API tokens.