@@ -55,25 +55,24 @@ npm i @rajesh896/broprint.js
5555yarn add @rajesh896/broprint.js
5656```
5757
58- ### Using CDN (jsDelivr):
59- You can load Broprint.js directly in the browser with a free CDN:
58+ ### Using CDN (jsDelivr) (v2.2.0+)
59+ You can load Broprint.js directly in the browser in two ways:
60+
61+ ESM (modern browsers):
6062
6163``` html
6264<script type =" module" >
63- import { getCurrentBrowserFingerPrint } from ' https://cdn.jsdelivr.net/npm/@rajesh896/broprint.js@latest/lib/index.js' ;
64- getCurrentBrowserFingerPrint ().then (fingerprint => {
65- console .log (' Browser fingerprint:' , fingerprint);
66- });
65+ import { getCurrentBrowserFingerPrint } from ' https://cdn.jsdelivr.net/npm/@rajesh896/broprint.js@latest/lib/index.mjs' ;
66+ getCurrentBrowserFingerPrint ().then (fp => console .log (' Fingerprint:' , fp));
6767 </script >
6868```
6969
70- Or, for classic script usage (exposes as a global ):
70+ Classic global (no module support needed ):
7171
7272``` html
73- <script src =" https://cdn.jsdelivr.net/npm/@rajesh896/broprint.js@latest/lib/index.js" ></script >
73+ <script src =" https://cdn.jsdelivr.net/npm/@rajesh896/broprint.js@latest/lib/index.global. js" ></script >
7474<script >
75- // If the library exposes a global (update if UMD/global build is added)
76- // Example: window.getCurrentBrowserFingerPrint()
75+ getCurrentBrowserFingerPrint ().then (fp => console .log (' Fingerprint (global):' , fp));
7776 </script >
7877```
7978<br />
@@ -97,7 +96,7 @@ getCurrentBrowserFingerPrint().then((fingerprint) => {
9796
9897<br />
9998
100- > ### Using this script in the html files
99+ > ### Using this script in a plain HTML file (local install)
101100
102101 1 . Execute ` npm i @rajesh896/broprint.js `
103102 2 . Then -
@@ -115,7 +114,7 @@ getCurrentBrowserFingerPrint().then((fingerprint) => {
115114
116115<body >
117116 <script type =" module" >
118- import (" ./node_modules/@rajesh896/broprint.js/index.js " ).then ((module ) => {
117+ import (" ./node_modules/@rajesh896/broprint.js/lib/ index.mjs " ).then ((module ) => {
119118 module .getCurrentBrowserFingerPrint ().then ((fingerprint ) => {
120119 console .log (fingerprint);
121120 })
@@ -126,7 +125,7 @@ getCurrentBrowserFingerPrint().then((fingerprint) => {
126125</html >
127126```
128127
129- - From version ` 1.1.0 ` onwards we have a dependency ` crypto-js ` . If you do not want to have this dependency then use the earlier versions of this library .
128+ > Note: Since v2.0 crypto-js was removed. v2.2.0 introduced multi-format builds (ESM, CJS, Global) and proper CDN usage .
130129
131130If you want to use it in simple ` .html ` file, please read the ` index.html ` file in the root directory.
132131
0 commit comments