Skip to content

Commit 00240ad

Browse files
Simplify JavaScript interop page to link to JavaScriptKit docs
1 parent 238eba0 commit 00240ad

File tree

1 file changed

+1
-25
lines changed

1 file changed

+1
-25
lines changed
Lines changed: 1 addition & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,3 @@
11
# JavaScript interoperation
22

3-
[JavaScriptKit](https://github.com/swiftwasm/JavaScriptKit) is a Swift framework to interact with JavaScript through WebAssembly.
4-
5-
You can use any JavaScript API from Swift with this library. Here's a quick example of JavaScriptKit
6-
usage in a browser app:
7-
8-
```swift
9-
import JavaScriptKit
10-
11-
let document = JSObject.global.document
12-
13-
var divElement = document.createElement("div")
14-
divElement.innerText = "Hello, world"
15-
_ = document.body.appendChild(divElement)
16-
```
17-
18-
You can also use JavaScriptKit in SwiftWasm apps integrated with Node.js, as there no assumptions
19-
that any browser API is present in the library.
20-
21-
JavaScriptKit consists of a runtime library package [hosted on
22-
npm](https://www.npmjs.com/package/javascript-kit-swift), and a SwiftPM package for the API on the
23-
Swift side. To integrate the JavaScript runtime automatically into your app, we recommend following
24-
the corresponding [guide for browser apps in our book](./browser-app.md).
25-
26-
27-
You can get more detailed JavaScriptKit documentation [here](https://swiftwasm.github.io/JavaScriptKit/).
3+
See the [JavaScriptKit documentation](https://swiftpackageindex.com/swiftwasm/JavaScriptKit/documentation/javascriptkit) for details on how to interact with JavaScript from Swift.

0 commit comments

Comments
 (0)