Installations
npm install mouse-detection
Developer Guide
Typescript
No
Module System
UMD
Node Version
12.18.4
NPM Version
6.10.3
Score
69.7
Supply Chain
72.9
Quality
75.4
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (90.93%)
HTML (9.07%)
Love this project? Help keep it running — sponsor us today! 🚀
Developer
olarsson
Download Statistics
Total Downloads
1,285
Last Day
1
Last Week
5
Last Month
25
Last Year
242
GitHub Statistics
10 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
1.87 kB
Minified
824.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.1.2
Package Id
mouse-detection@1.1.2
Unpacked Size
10.77 kB
Size
3.81 kB
File Count
9
NPM Version
6.10.3
Node Version
12.18.4
Total Downloads
Cumulative downloads
Total Downloads
1,285
Last day
0%
1
Compared to previous day
Last week
-44.4%
5
Compared to previous week
Last month
127.3%
25
Compared to previous month
Last year
59.2%
242
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
MouseDetection
Detects the prescence of a mouse as reliably as possible.
Live demo
The problem
There is currently no 100% way to detect the prescence of a mouse in the browser without making false assumptions. This project attempts to solve this problem.
How?
This project detects the prescence of a mouse based on event acceleration from the mousemove event within a timeframe. If a certain number of events are reached within a specific timeframe it will assume the prescence of a mouse. A promise is resolved when the mouse is detected.
Installation
1npm i mouse-detection
Usage
1import { MouseDetection } from 'mouse-detection';
2
3MouseDetection({ // this configuration object is optional
4 eventLimitCount: 4, // number of events to listen for within the timespan
5 eventLimitTimeSpan: 200, // the timespan in ms
6})
7 .then(() => {
8 console.log('mouse detected.');
9 });
Why cant I see if a mouse is present right away?
This is not possible since we always have to start on the assumption that we don't know if a mouse exists. The user has to prove this to be false. It's only once the mouse starts moving that we can actually make a reasonable assumption that it's there.
![Empty State](/_next/static/media/empty.e5fae2e5.png)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 0/10 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no SAST tool detected
Details
- Warn: no pull requests merged into dev branch
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
license file not detected
Details
- Warn: project does not have a license file
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
branch protection not enabled on development/release branches
Details
- Warn: branch protection not enabled for branch 'master'
Reason
26 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-w8qv-6jwh-64r5
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-gxpj-cx7g-858c
- Warn: Project is vulnerable to: GHSA-ww39-953v-wcq6
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-76p3-8jx3-jpfq
- Warn: Project is vulnerable to: GHSA-3rfm-jhwj-7488
- Warn: Project is vulnerable to: GHSA-hhq3-ff78-jv3g
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-qrpm-p2h7-hrv2
- Warn: Project is vulnerable to: GHSA-mwcw-c2x4-8c55
- Warn: Project is vulnerable to: GHSA-hj48-42vr-x3v9
- Warn: Project is vulnerable to: GHSA-hwj9-h5mp-3pm3
- Warn: Project is vulnerable to: GHSA-566m-qj78-rww5
- Warn: Project is vulnerable to: GHSA-7fh5-64p2-3v2j
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-4wf5-vphf-c2xc
- Warn: Project is vulnerable to: GHSA-hc6q-2mpp-qw7j
- Warn: Project is vulnerable to: GHSA-4vvj-4cpr-p986
- Warn: Project is vulnerable to: GHSA-j8xg-fqg3-53r7
Score
1.3
/10
Last Scanned on 2025-02-03
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to mouse-detection
mouse-detection-tool
Detects the prescence of a mouse as reliably as possible. [Live demo](https://olarsson.github.io/mouse-detection/example/index.html)
wheel-gestures
wheel gestures and momentum detection
touchsweep
Super tiny vanilla JS module to detect swipe direction
@jpweeks/touchsweep
Super tiny vanilla JS module to detect swipe direction