Skip to content

qasim/ChakraCore-Cocoa

Repository files navigation

ChakraCore-Cocoa

This is a very rudimentary sample of building macOS applications that can run JavaScript through Microsoft's ChakraCore engine.

Requirements

ChakraCore itself has the following requirements:

$ brew install cmake icu4c

Setup

Clone the repository and all of its submodules:

$ git clone --recursive https://github.com/qasim/ChakraCore-Cocoa.git && cd ChakraCore-Cocoa

Then, we can generate ChakraCore's Xcode project files:

$ ./ChakraCore/build.sh --xcode --icu=/usr/local/opt/icu4c/include

Usage

Open the Xcode workspace:

$ open ChakraCore-Cocoa.xcworkspace

That's it! Build and run the ChakraCore-Cocoa target to see the sample file being executed by ChakraCore, and then printed to console, all inside a macOS app.

What's next?

This can be used to build native macOS applications that may depend on a shared JS library. One could build a Cocoa wrapper on top of ChakraCore to create an alternative to Apple's JavaScriptCore.

What about iOS?

At the time of writing, ChakraCore cannot be built for iOS targets yet (Microsoft/ChakraCore#1237).

About

Run JavaScript in macOS apps through Microsoft's ChakraCore engine.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published