
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Lightweight, dependency-free library for smooth mobile pinch-zoom and panning on any HTML element.
Pinchable is a lightweight, dependency-free JavaScript library that adds smooth pinch-zoom and panning to any HTML element — perfect for mobile galleries.
Try Pinchable live:
Scan to open the live demo:
| Playground | React demo | Vue demo |
|---|---|---|
focus({ zoom, to }) using normalized [0–1] coordinatessetEnabled()"start", "pinch", "end" + unsubscribe() helpersdispose()npm install pinchable
or
yarn add pinchable
import { Pinchable } from "pinchable";
const container = document.getElementById("photo")!;
const pinchable = new Pinchable(container, {
maxZoom: 3,
minZoom: 0.5,
edgeZoomThreshold: 0.2,
nearZeroZoomThreshold: 0.07,
shiftThreshold: 10,
velocity: 0.7,
applyTime: 400,
});
// Zoom to center
pinchable.focus({ zoom: 2, to: { x: 0.5, y: 0.5 } });
// Disable or enable gestures
pinchable.setEnabled(false);
pinchable.setEnabled(true);
// Subscribe to events
const unsubscribePinch = pinchable.subscribe("pinch", (zoom, shift) => {
console.log("zoom", zoom, "shift", shift);
});
// Cleanup
unsubscribePinch();
pinchable.dispose();
| Method | Description |
|---|---|
focus({ zoom, to }) | Programmatically zoom to a specific normalized point |
setEnabled(enabled: boolean) | Enable or disable gestures |
subscribe(event, handler) | Listen to "start", "pinch", or "end" events (returns unsubscribe()) |
dispose() | Remove listeners and reset element |
Options
| Option | Default | Description |
|---|---|---|
maxZoom | 3 | Maximum zoom factor |
minZoom | 1 | Minimum zoom factor |
edgeZoomThreshold | 0.2 | Overshoot tolerance before clamping |
nearZeroZoomThreshold | 0.07 | Smoothing zone near zoom = 1 |
shiftThreshold | 10 | Extra pixels beyond edges before clamping |
velocity | 0.7 | Pinch sensitivity |
applyTime | 400 | Duration (ms) for programmatic zoom transition |
git clone https://github.com/AlexanderShushunov/pinchable
cd pinch
npm install
npm run dev
MIT © Alexander Shushunov
Keywords: pinch zoom, gesture, touch, pan, mobile, pinchable, pinch-zoom, pointer events, no dependencies, vanilla js
FAQs
Lightweight, dependency-free library for smooth mobile pinch-zoom and panning on any HTML element.
The npm package pinchable receives a total of 1 weekly downloads. As such, pinchable popularity was classified as not popular.
We found that pinchable 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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.