File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -39,17 +39,15 @@ npm install 30-seconds-of-code
3939yarn add 30-seconds-of-code
4040```
4141
42- [ CDN link] ( https://unpkg.com/30-seconds-of-code/ )
42+ [ CDN link] ( https://unpkg.com/30-seconds-of-code@2 / )
4343
4444<details >
4545<summary >Details</summary >
4646
4747** Browser**
4848
49- > IMPORTANT: replace the ` src ` with the full version link and desired target spec (such as ES5 minified)):
50-
5149``` html
52- <script src =" https://unpkg.com/30-seconds-of-code" ></script >
50+ <script src =" https://unpkg.com/30-seconds-of-code@2 " ></script >
5351<script >
5452 _30s .average (1 , 2 , 3 );
5553 </script >
@@ -62,19 +60,7 @@ yarn add 30-seconds-of-code
6260const _30s = require (' 30-seconds-of-code' );
6361_30s .average (1 , 2 , 3 );
6462
65- // ES Modules
66- import _30s from ' 30-seconds-of-code' ;
67- _30s .average (1 , 2 , 3 );
68- ```
69-
70- To import snippets directly:
71-
72- ``` js
73- // CommonJS
74- const { average } = require (' 30-seconds-of-code' );
75- average (1 , 2 , 3 );
76-
77- // ES Modules
63+ // ES Modules (tree-shaking support)
7864import { average } from ' 30-seconds-of-code' ;
7965average (1 , 2 , 3 );
8066```
You can’t perform that action at this time.
0 commit comments