Skip to content

Commit fca1fa0

Browse files
committed
Add various instructions
1 parent d901220 commit fca1fa0

File tree

1 file changed

+20
-4
lines changed

1 file changed

+20
-4
lines changed

README.md

Lines changed: 20 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,32 @@ Usage
2929

3030
The package exports an ECMAScript module with an UMD fallback.
3131

32+
```sh
33+
$> npm install long
34+
```
35+
3236
```js
3337
import Long from "long";
3438

35-
var longVal = new Long(0xFFFFFFFF, 0x7FFFFFFF);
36-
37-
console.log(longVal.toString());
39+
var value = new Long(0xFFFFFFFF, 0x7FFFFFFF);
40+
console.log(value.toString());
3841
...
3942
```
4043

41-
Note that mixing ESM and CommonJS is not recommended as it yield different classes with the same functionality.
44+
Note that mixing ESM and CommonJS is not recommended as it yields different classes, albeit with the same functionality.
45+
46+
### Usage with a CDN
47+
48+
* From GitHub via [jsDelivr](https://www.jsdelivr.com):<br />
49+
`https://cdn.jsdelivr.net/gh/dcodeIO/long.js@TAG/index.js` (ESM)
50+
* From npm via [jsDelivr](https://www.jsdelivr.com):<br />
51+
`https://cdn.jsdelivr.net/npm/long@VERSION/index.js` (ESM)
52+
`https://cdn.jsdelivr.net/npm/long@VERSION/umd/index.js` (UMD)
53+
* From npm via [unpkg](https://unpkg.com):<br />
54+
`https://unpkg.com/long@VERSION/index.js` (ESM)
55+
`https://unpkg.com/long@VERSION/umd/index.js` (UMD)
56+
57+
Replace `TAG` respectively `VERSION` with a [specific version](https://github.com/AssemblyScript/binaryen.js/releases) or omit it (not recommended in production) to use main/latest.
4258

4359
API
4460
---

0 commit comments

Comments
 (0)