
Product
Secure Your AI-Generated Code with Socket MCP
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
swiperia-core
Advanced tools
Swiperia Core: The foundational engine for handling swipe gestures in JavaScript. Provides platform-agnostic utilities to detect swipe direction, calculate distance and velocity, and analyze swipe movement data.
Swiperia Core is the foundation of the Swiperia library, providing essential utilities and functions for handling swipe gestures and calculating swipe-related metrics. This package is designed to be platform-agnostic and can be used in any JavaScript environment, including the browser, Node.js, and React Native.
start
, move
, end
, and cancel
.You can install the swiperia-core
package using npm or yarn:
npm install swiperia-core
# or
yarn add swiperia-core
Here's a basic example of how to use the swiperia-core package:
import { direction, distance, movement, velocity, vxvy } from 'swiperia-core';
const start = [100, 200];
const end = [300, 250];
const duration = 500; // in milliseconds
const swipeData = movement(start, end, duration);
console.log('Swipe Direction:', direction(start, end)); // Output: 'right'
console.log('Swipe Distance:', distance(start, end)); // Output: 208.06...
console.log('Swipe Velocity:', velocity(start, end, duration)); // Output: 416.12...
console.log('Swipe Velocity (x, y):', vxvy(start, end, duration)); // Output: [400, 100]
console.log('Swipe Movement:', swipeData);
For detailed documentation, including API references and advanced usage examples, please visit the Swiperia Documentation.
We welcome contributions from the community! If you'd like to contribute to Swiperia Core, please read our Contributing Guide for more information.
Swiperia Core is released under the MIT License.
FAQs
Swiperia Core: The foundational engine for handling swipe gestures in JavaScript. Provides platform-agnostic utilities to detect swipe direction, calculate distance and velocity, and analyze swipe movement data.
The npm package swiperia-core receives a total of 235 weekly downloads. As such, swiperia-core popularity was classified as not popular.
We found that swiperia-core demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer 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.
Product
Socket MCP brings real-time security checks to AI-generated code, helping developers catch risky dependencies before they enter the codebase.
Security News
As vulnerability data bottlenecks grow, the federal government is formally investigating NIST’s handling of the National Vulnerability Database.
Research
Security News
Socket’s Threat Research Team has uncovered 60 npm packages using post-install scripts to silently exfiltrate hostnames, IP addresses, DNS servers, and user directories to a Discord-controlled endpoint.