|
23 | 23 | <a href="https://github.com/RichardLitt/standard-readme"><img src="https://img.shields.io/badge/standard--readme-OK-green.svg?style=flat-square" /></a>
|
24 | 24 | <a href=""><img src="https://img.shields.io/badge/npm-%3E%3D3.0.0-orange.svg?style=flat-square" /></a>
|
25 | 25 | <a href=""><img src="https://img.shields.io/badge/Node.js-%3E%3D10.0.0-orange.svg?style=flat-square" /></a>
|
| 26 | + <a href="https://www.npmjs.com/package/ipfs-http-client"><img src="https://img.shields.io/npm/dm/ipfs-http-client.svg" /></a> |
| 27 | + <a href="https://www.jsdelivr.com/package/npm/ipfs-http-client"><img src="https://data.jsdelivr.com/v1/package/npm/ipfs-http-client/badge"/></a> |
26 | 28 | <br>
|
27 | 29 | </p>
|
28 | 30 |
|
@@ -128,26 +130,28 @@ See the example in the [examples folder](examples/bundle-webpack) to get an idea
|
128 | 130 |
|
129 | 131 | **from CDN**
|
130 | 132 |
|
131 |
| -Instead of a local installation (and browserification) you may request a remote copy of IPFS API from [unpkg CDN](https://unpkg.com/). |
| 133 | +Instead of a local installation (and browserification) you may request a remote copy of IPFS API from [jsDelivr](https://www.jsdelivr.com/package/npm/ipfs). |
132 | 134 |
|
133 |
| -To always request the latest version, use the following: |
| 135 | +To always request the latest version, use one of the following examples: |
134 | 136 |
|
135 | 137 | ```html
|
136 |
| -<script src="https://unpkg.com/ipfs-http-client/dist/index.min.js"></script> |
137 |
| -``` |
| 138 | +<!-- loading the minified version using jsDelivr --> |
| 139 | +<script src="https://cdn.jsdelivr.net/npm/ipfs-http-client/dist/index.min.js"></script> |
138 | 140 |
|
139 |
| -Note: remove the `.min` from the URL to get the human-readable (not minified) version. |
| 141 | +<!-- loading the human-readable (not minified) version jsDelivr --> |
| 142 | +<script src="https://cdn.jsdelivr.net/npm/ipfs-http-client/dist/index.js"></script> |
| 143 | +``` |
140 | 144 |
|
141 | 145 | For maximum security you may also decide to:
|
142 | 146 |
|
143 | 147 | * reference a specific version of IPFS API (to prevent unexpected breaking changes when a newer latest version is published)
|
144 |
| -* [generate a SRI hash](https://www.srihash.org/) of that version and use it to ensure integrity |
| 148 | +* [generate a SRI hash](https://www.srihash.org/) of that version and use it to ensure integrity. Learn more also at the [jsdelivr website](https://www.jsdelivr.com/using-sri-with-dynamic-files) |
145 | 149 | * set the [CORS settings attribute](https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes) to make anonymous requests to CDN
|
146 | 150 |
|
147 | 151 | Example:
|
148 | 152 |
|
149 | 153 | ```html
|
150 |
| -<script src="https://unpkg.com/ipfs-http-client@9.0.0/dist/index.js" |
| 154 | +<script src="https://www.jsdelivr.com/package/npm/ipfs-http-client" |
151 | 155 | integrity="sha384-5bXRcW9kyxxnSMbOoHzraqa7Z0PQWIao+cgeg327zit1hz5LZCEbIMx/LWKPReuB"
|
152 | 156 | crossorigin="anonymous"></script>
|
153 | 157 | ```
|
|
0 commit comments