forked fromswiftwasm/JavaScriptKit
- Notifications
You must be signed in to change notification settings - Fork0
Swift framework to interact with JavaScript through WebAssembly.
License
NotificationsYou must be signed in to change notification settings
PassiveLogic/JavaScriptKit
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Swift framework to interact with JavaScript through WebAssembly.
Check out theHello World tutorial for a step-by-step guide to getting started.
JavaScriptKit provides a seamless way to interact with JavaScript from Swift code when compiled to WebAssembly. It allows Swift developers to:
- Access JavaScript objects and functions
- Create closures that can be called from JavaScript
- Convert between Swift and JavaScript data types
- Use JavaScript promises with Swift's
async/await - Work with multi-threading
import JavaScriptKit// Access global JavaScript objectsletdocument=JSObject.global.document// Create and manipulate DOM elementsvardiv= document.createElement("div")div.innerText="Hello from Swift!"_= document.body.appendChild(div)// Handle events with Swift closuresvarbutton= document.createElement("button")button.innerText="Click me"button.onclick=.object(JSClosure{ _inJSObject.global.alert!("Button clicked!")return.undefined})_= document.body.appendChild(button)
Check out theexamples for more detailed usage.
Contributions are welcome! SeeCONTRIBUTING.md for details on how to contribute to the project.
Become a gold or platinum sponsor and contact maintainers to add your logo on our README on Github with a link to your site.

About
Swift framework to interact with JavaScript through WebAssembly.
Resources
License
Contributing
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Releases
No releases published
Packages0
No packages published
Languages
- Swift67.4%
- JavaScript28.3%
- TypeScript2.6%
- C1.5%
- HTML0.1%
- Shell0.1%