Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
JavaScriptSwift.xcodeproj
Sources/JavaScriptSwift
Tests
.gitignore
.swiftformat
.travis.yml
LICENSE
Package.swift
README.md

README.md

JavaScriptSwift

JavaScriptSwift library to run JavaScript in pure iOS Swift.

CI Status

Example

Use JavaScriptSwift.import to import JavaScript context to your project. For example:

import JavaScriptSwift

let context = JavaScriptSwift()
try context.importSafe("""
var swiftLib = {
    name: "JavaScript.swift",
    organizers: [
        {
            name: "Matvii",
            twitter: "@hodovani",
            email: "matvii@hodovani.uk"
        },
        {
            name: "Max",
            twitter: "@maxdesiatov",
            email: "max@desiatov.com"
        }
    ]
};
""")

Now you can access swiftLib fields. For example:

var conference = context.swiftLib.name
// conference will be "JavaScript.swift"

Requirements

  • Xcode 10.2
  • Swift 5.0
  • iOS 7.0+ / macOS 10.5+ / tvOS 9.0+

Author

Matvii Hodovaniuk

License

JavaScriptSwift is available under the Apache 2.0 license. See the LICENSE file for more info.

You can’t perform that action at this time.