-
Notifications
You must be signed in to change notification settings - Fork 105
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* adjust readme * futz * v0.25.1
- Loading branch information
Showing
63 changed files
with
357 additions
and
285 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -521,32 +521,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 | ||
|
||
|
@@ -572,12 +572,28 @@ See the [documentation of quickjs-emscripten-core][core] for more details. | |
|
||
```typescript | ||
import { newQuickJSWASMModuleFromVariant } from "quickjs-emscripten-core" | ||
import DEBUG_SYNC from "@jitl/quickjs-node-esm-debug-sync-wasm" | ||
import DEBUG_SYNC from "@jitl/quickjs-wasmfile-debug-sync" | ||
|
||
const QuickJS = await newQuickJSWASMModuleFromVariant(DEBUG_SYNC) | ||
``` | ||
|
||
- Set `process.env.QTS_DEBUG` to see debug log messages from the Javascript part of this library. | ||
- Enable debug log messages from the Javascript part of this library with [setDebugMode][setDebugMode]: | ||
|
||
```typescript | ||
import { setDebugMode } from "quickjs-emscripten" | ||
|
||
setDebugMode(true) | ||
``` | ||
|
||
With quickjs-emscripten-core: | ||
|
||
```typescript | ||
import { setDebugMode } from "quickjs-emscripten-core" | ||
|
||
setDebugMode(true) | ||
``` | ||
|
||
[setDebugMode]: doc/quickjs-emscripten/exports.md#setdebugmode | ||
|
||
### More Documentation | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.