Skip to content

Commit 7ce27c0

Browse files
committed
feat: update README and changelog for v2.2.0 with new CDN usage examples and multi-format builds
1 parent 5e529e4 commit 7ce27c0

File tree

3 files changed

+29
-14
lines changed

3 files changed

+29
-14
lines changed

README.MD

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -55,25 +55,24 @@ npm i @rajesh896/broprint.js
5555
yarn 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
131130
If you want to use it in simple `.html` file, please read the `index.html` file in the root directory.
132131

changelog.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,22 @@
11
# Changelog
22
All notable changes to this project will be documented in this file.
33

4+
## [2.2.0] - 2025-08-11
5+
6+
### Added
7+
8+
- Multi-format build: ESM (`index.mjs`), CJS (`index.js`), and global/IIFE (`index.global.js`).
9+
- Export map for proper Node/ bundler resolution.
10+
- Automatic global `getCurrentBrowserFingerPrint` exposure for classic `<script>` usage.
11+
12+
### Fixed
13+
14+
- CDN usage now works for both `<script type=module>` and classic `<script>` tags.
15+
16+
### Docs
17+
18+
- README updated with new CDN examples and removed outdated crypto-js reference.
19+
420
## [2.1.0] - 2022-05-18
521
### Added
622
- Logical conditions added for brave browser

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@rajesh896/broprint.js",
3-
"version": "2.1.1",
3+
"version": "2.2.0",
44
"description": "The world's easiest, smallest and powerful visitor identifier for browsers.",
55
"main": "./lib/index.js",
66
"module": "./lib/index.mjs",

0 commit comments

Comments
 (0)