Skip to content

Commit e9f2587

Browse files
authored
docs: document jspm usage (#473)
Thanks to pkg.exports this module is now well-supported by https://jspm.org/ without any Node.js crypto api polyfills for the browser.
1 parent e5075c8 commit e9f2587

File tree

2 files changed

+32
-6
lines changed

2 files changed

+32
-6
lines changed

README.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
88

99
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
1010
- **Cross-platform** - Support for ...
11-
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds (UMD)](#cdn-builds-umd)
11+
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
1212
- Node 8, 10, 12, 14
1313
- Chrome, Safari, Firefox, Edge, IE 11 browsers
1414
- Webpack and rollup.js module bundlers
@@ -305,9 +305,22 @@ To run the examples you must first create a dist build of this library in the mo
305305
npm run build
306306
```
307307

308-
## CDN Builds (UMD)
308+
## CDN Builds
309309

310-
This module may be loaded directly into a browser from any of the following CDNs:
310+
### ECMAScript Modules
311+
312+
To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/):
313+
314+
```html
315+
<script type="module">
316+
import { v4 as uuidv4 } from 'https://jspm.dev/uuid';
317+
console.log(uuidv4()); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
318+
</script>
319+
```
320+
321+
### UMD
322+
323+
To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs:
311324

312325
**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**:
313326

README_js.md

+16-3
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ For the creation of [RFC4122](http://www.ietf.org/rfc/rfc4122.txt) UUIDs
2020

2121
- **Complete** - Support for RFC4122 version 1, 3, 4, and 5 UUIDs
2222
- **Cross-platform** - Support for ...
23-
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds (UMD)](#cdn-builds-umd)
23+
- CommonJS, [ECMAScript Modules](#ecmascript-modules) and [CDN builds](#cdn-builds)
2424
- Node 8, 10, 12, 14
2525
- Chrome, Safari, Firefox, Edge, IE 11 browsers
2626
- Webpack and rollup.js module bundlers
@@ -294,9 +294,22 @@ To run the examples you must first create a dist build of this library in the mo
294294
npm run build
295295
```
296296

297-
## CDN Builds (UMD)
297+
## CDN Builds
298298

299-
This module may be loaded directly into a browser from any of the following CDNs:
299+
### ECMAScript Modules
300+
301+
To load this module directly into modern browsers that [support loading ECMAScript Modules](https://caniuse.com/#feat=es6-module) you can make use of [jspm](https://jspm.org/):
302+
303+
```html
304+
<script type="module">
305+
import { v4 as uuidv4 } from 'https://jspm.dev/uuid';
306+
console.log(uuidv4()); // ⇨ '1b9d6bcd-bbfd-4b2d-9b5d-ab8dfbbd4bed'
307+
</script>
308+
```
309+
310+
### UMD
311+
312+
To load this module directly into older browsers you can use the [UMD (Universal Module Definition)](https://github.com/umdjs/umd) builds from any of the following CDNs:
300313

301314
**Using [UNPKG](https://unpkg.com/uuid@latest/dist/umd/)**:
302315

0 commit comments

Comments
 (0)