browser-haptic 1.0.2 → 1.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +31 -2
- package/package.json +24 -4
package/README.md
CHANGED
|
@@ -1,13 +1,42 @@
|
|
|
1
1
|
# browser-haptic
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
[](https://www.npmjs.com/package/browser-haptic)
|
|
4
|
+
[](https://www.npmjs.com/package/browser-haptic)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
|
|
7
|
+
Lightweight haptic feedback for JavaScript. Uses the [Vibration API](https://developer.mozilla.org/en-US/docs/Web/API/Vibration_API) where available (e.g. Android). On **iOS Safari 17.4+** it uses a hidden `input[switch]` toggle so the native switch haptic fires. No runtime dependencies.
|
|
8
|
+
|
|
9
|
+
- [Install](#install)
|
|
10
|
+
- [Usage](#usage)
|
|
11
|
+
- [API](#api)
|
|
12
|
+
- [Contributing](#contributing)
|
|
4
13
|
|
|
5
14
|
## Install
|
|
6
15
|
|
|
16
|
+
**npm**
|
|
17
|
+
|
|
18
|
+
```bash
|
|
19
|
+
npm install browser-haptic
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
**bun**
|
|
23
|
+
|
|
7
24
|
```bash
|
|
8
25
|
bun add browser-haptic
|
|
9
26
|
```
|
|
10
27
|
|
|
28
|
+
**pnpm**
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
pnpm add browser-haptic
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**yarn**
|
|
35
|
+
|
|
36
|
+
```bash
|
|
37
|
+
yarn add browser-haptic
|
|
38
|
+
```
|
|
39
|
+
|
|
11
40
|
## Usage
|
|
12
41
|
|
|
13
42
|
Import the default export as **`Haptic`** and call its methods:
|
|
@@ -71,4 +100,4 @@ For bugs or feature ideas, please open an issue first so we can discuss.
|
|
|
71
100
|
|
|
72
101
|
## License
|
|
73
102
|
|
|
74
|
-
MIT Copyright (c)
|
|
103
|
+
MIT Copyright (c) 2026 Emirhan Kemal Kosem
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "browser-haptic",
|
|
3
|
-
"version": "1.0.
|
|
4
|
-
"description": "Lightweight haptic feedback for
|
|
3
|
+
"version": "1.0.4",
|
|
4
|
+
"description": "Lightweight haptic feedback for web apps. Vibration API (Android) + iOS Safari 17.4+ switch fallback. Zero dependencies.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -31,15 +31,35 @@
|
|
|
31
31
|
"keywords": [
|
|
32
32
|
"browser-haptic",
|
|
33
33
|
"haptic",
|
|
34
|
+
"haptic-feedback",
|
|
34
35
|
"vibration",
|
|
35
36
|
"vibrate",
|
|
37
|
+
"vibration-api",
|
|
36
38
|
"ios",
|
|
37
39
|
"safari",
|
|
38
|
-
"
|
|
40
|
+
"android",
|
|
39
41
|
"mobile",
|
|
40
|
-
"
|
|
42
|
+
"mobile-web",
|
|
43
|
+
"pwa",
|
|
44
|
+
"tactile",
|
|
45
|
+
"touch-feedback",
|
|
46
|
+
"ux",
|
|
47
|
+
"zero-dependencies"
|
|
41
48
|
],
|
|
42
49
|
"license": "MIT",
|
|
50
|
+
"author": {
|
|
51
|
+
"name": "Emirhan Kemal Kosem",
|
|
52
|
+
"email": "emirhankemalkosem@gmail.com",
|
|
53
|
+
"url": "https://github.com/KemalEmirhan"
|
|
54
|
+
},
|
|
55
|
+
"repository": {
|
|
56
|
+
"type": "git",
|
|
57
|
+
"url": "https://github.com/KemalEmirhan/browser-haptic.git"
|
|
58
|
+
},
|
|
59
|
+
"homepage": "https://github.com/KemalEmirhan/browser-haptic#readme",
|
|
60
|
+
"bugs": {
|
|
61
|
+
"url": "https://github.com/KemalEmirhan/browser-haptic/issues"
|
|
62
|
+
},
|
|
43
63
|
"engines": {
|
|
44
64
|
"node": ">=18"
|
|
45
65
|
},
|