Skip to content

Commit

Permalink
📝 Update readme import section
Browse files Browse the repository at this point in the history
  • Loading branch information
elbywan committed Nov 2, 2020
1 parent 4888bee commit 5970e6d
Showing 1 changed file with 25 additions and 4 deletions.
29 changes: 25 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -212,17 +212,38 @@ console.log(text) // -> 200 OK

## Import

#### <script> tag

```html
<!--- "wretch" will be attached to the global window object. -->
<!--
Pick your favourite CDN:
- https://unpkg.com
- https://www.jsdelivr.com/package/npm/wretch
- https://www.skypack.dev/view/wretch
- https://cdnjs.com/libraries/wretch
-->

<!-- UMD import as window.wretch -->
<script src="https://unpkg.com/wretch"></script>

<!-- Modern import -->
<script type="module">
import wretch from 'https://cdn.skypack.dev/wretch'
// ... //
</script>
```

#### ESModule

```typescript
// es2015 modules
import wretch from "wretch"
```

#### CommonJS

// commonjs
var wretch = require("wretch")
```typescript
const wretch = require("wretch")
```

## Code
Expand Down

0 comments on commit 5970e6d

Please sign in to comment.