highlighter-pen 1.0.1 → 1.0.2

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 CHANGED
@@ -34,13 +34,25 @@ It behaves like a real highlighter: drag your mouse over text and see a custom o
34
34
  ### CDN (recommended)
35
35
 
36
36
  ```html
37
- <script src="https://cdn.jsdelivr.net/gh/mimoklef/highlighter-pen@v1.0.0/dist/highlighter-pen.js"></script>
37
+ <script src="https://cdn.jsdelivr.net/gh/mimoklef/highlighter-pen@v1.0.2/dist/highlighter-pen.js"></script>
38
38
  <script>
39
39
  HighlighterPen().init();
40
40
  </script>
41
41
  ```
42
42
 
43
+ ### NPM
43
44
 
45
+ ```bash
46
+ npm install highlighter-pen
47
+ ```
48
+
49
+ And import it with
50
+
51
+ ```js
52
+ const HighlighterPen = require("highlighter-pen");
53
+
54
+ HighlighterPen().init();
55
+ ```
44
56
 
45
57
  ## 🙋🏻‍♂️ Author
46
58
 
@@ -9,7 +9,7 @@
9
9
  "use strict";
10
10
 
11
11
  const DEFAULTS = {
12
- markerImage: "https://cdn.jsdelivr.net/gh/mimoklef/highlighter-pen@v1.0.1/assets/marker.png",
12
+ markerImage: "https://cdn.jsdelivr.net/gh/mimoklef/highlighter-pen@v1.0.2/assets/marker.png",
13
13
  markerZIndex: 10, // marker overlays on text
14
14
  hideNativeSelection: true, // hide ::selection (so only your marker is visible)
15
15
  inputSelectionYellow: true, // keep native selection in inputs/textarea and tint it yellow
@@ -213,4 +213,9 @@ input::-moz-selection, textarea::-moz-selection { background: ${opt.inputSelecti
213
213
  }
214
214
 
215
215
  global.HighlighterPen = HighlighterPen;
216
- })(typeof window !== "undefined" ? window : this);
216
+ })(typeof window !== "undefined" ? window : this);
217
+
218
+ // --- npm / node export (CommonJS) ---
219
+ if (typeof module !== "undefined" && typeof module.exports !== "undefined") {
220
+ module.exports = globalThis.HighlighterPen;
221
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "highlighter-pen",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "description": "Marker-like text selection overlay (live) using JavaScript + CSS injection",
5
5
  "license": "MIT",
6
6
  "main": "dist/highlighter-pen.js",