Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
justjake committed Dec 27, 2023
1 parent 39002d1 commit f2f4078
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 46 deletions.
46 changes: 23 additions & 23 deletions doc/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -525,32 +525,32 @@ You can use quickjs-emscripten directly from an HTML file in two ways:

1. Import it in an ES Module script tag

```html
<!doctype html>
<!-- Import from a ES Module CDN -->
<script type="module">
import { getQuickJS } from "https://esm.sh/[email protected]"
const QuickJS = await getQuickJS()
console.log(QuickJS.evalCode("1+1"))
</script>
```
```html
<!doctype html>
<!-- Import from a ES Module CDN -->
<script type="module">
import { getQuickJS } from "https://esm.sh/[email protected]"
const QuickJS = await getQuickJS()
console.log(QuickJS.evalCode("1+1"))
</script>
```

1. In edge cases, you might want to use the IIFE build which provides QuickJS as the global `QJS`. You should probably use the ES module though, any recent browser supports it.

```html
<!doctype html>
<!-- Add a script tag to load the library as the QJS global -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.global.js"
type="text/javascript"
></script>
<!-- Then use the QJS global in a script tag -->
<script type="text/javascript">
QJS.getQuickJS().then((QuickJS) => {
console.log(QuickJS.evalCode("1+1"))
})
</script>
```
```html
<!doctype html>
<!-- Add a script tag to load the library as the QJS global -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.global.js"
type="text/javascript"
></script>
<!-- Then use the QJS global in a script tag -->
<script type="text/javascript">
QJS.getQuickJS().then((QuickJS) => {
console.log(QuickJS.evalCode("1+1"))
})
</script>
```

### quickjs-emscripten-core, variants, and advanced packaging

Expand Down
46 changes: 23 additions & 23 deletions doc/quickjs-emscripten/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -546,32 +546,32 @@ You can use quickjs-emscripten directly from an HTML file in two ways:

1. Import it in an ES Module script tag

```html
<!doctype html>
<!-- Import from a ES Module CDN -->
<script type="module">
import { getQuickJS } from "https://esm.sh/[email protected]"
const QuickJS = await getQuickJS()
console.log(QuickJS.evalCode("1+1"))
</script>
```
```html
<!doctype html>
<!-- Import from a ES Module CDN -->
<script type="module">
import { getQuickJS } from "https://esm.sh/[email protected]"
const QuickJS = await getQuickJS()
console.log(QuickJS.evalCode("1+1"))
</script>
```

1. In edge cases, you might want to use the IIFE build which provides QuickJS as the global `QJS`. You should probably use the ES module though, any recent browser supports it.

```html
<!doctype html>
<!-- Add a script tag to load the library as the QJS global -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.global.js"
type="text/javascript"
></script>
<!-- Then use the QJS global in a script tag -->
<script type="text/javascript">
QJS.getQuickJS().then((QuickJS) => {
console.log(QuickJS.evalCode("1+1"))
})
</script>
```
```html
<!doctype html>
<!-- Add a script tag to load the library as the QJS global -->
<script
src="https://cdn.jsdelivr.net/npm/[email protected]/dist/index.global.js"
type="text/javascript"
></script>
<!-- Then use the QJS global in a script tag -->
<script type="text/javascript">
QJS.getQuickJS().then((QuickJS) => {
console.log(QuickJS.evalCode("1+1"))
})
</script>
```

### quickjs-emscripten-core, variants, and advanced packaging

Expand Down

0 comments on commit f2f4078

Please sign in to comment.