# \[ANN\] JSCall.jl

**URL:** https://discourse.julialang.org/t/ann-jscall-jl/23700
**Category:** Community
**Created:** [April 30, 2019, 2:52pm UTC](https://discourse.julialang.org/t/ann-jscall-jl/23700 "2019-04-30T14:52:05Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![sdanisch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/sdanisch/32/1406_2.png) [@sdanisch](https://discourse.julialang.org/u/sdanisch)
#### Post date: [April 30, 2019, 2:52pm UTC](https://discourse.julialang.org/t/ann-jscall-jl/23700/1 "2019-04-30T14:52:05Z")

</div>

Hi,  
in order to make it easier to create the Makie WebGL backend, I put together [JSCall](https://github.com/SimonDanisch/JSCall.jl).  
By overloading getproperty and wrapping Javascript objects in Julia reference objects, it makes it very simple to call Javascript libraries.  
It’s still an early prototype, but should already work pretty well - the main remaining work will likely happen behind the scenes, to improve performance and polish the implementation.  
Simple demo:

```julia
# wrap a JS library and get the reference to the JS module and context:
JS, document, window = JSModule(
  :JSModuleName,
  "url/to/js/dependency/JS.js",
)
jsobject = JS.somefunc(1, "hi")
jlvalue(jsobject) # fetches the julia value from a js object
new_func = JS.somefunc(jsobject) # you can pass js objects to other functions
# you can call functions on any jsobject (of course only if they exist on the js side)
new_func([1,2,3])
# this works nicely for nested class/function calls:
JS.SomeClass.somefunc()

```

Complex demo:  
[Calling ThreeJS](https://nextjournal.com/sdanisch/jscall-demo)  
 ![](https://global.discourse-cdn.com/julialang/original/3X/8/2/82fa15500419b70307ca33c0f4e4787e98df5792.gif)

Btw, this builds on [WebIO](https://github.com/JuliaGizmos/WebIO.jl/graphs/contributors) by @shashi, which was heavily revamped to work more reliably by @travigd.

---

<div class="post-metadata">

### Author: ![anon67531922](https://avatars.discourse-cdn.com/v4/letter/a/48db29/32.png) [@anon67531922](https://discourse.julialang.org/u/anon67531922)
#### Post date: [April 30, 2019, 4:06pm UTC](https://discourse.julialang.org/t/ann-jscall-jl/23700/2 "2019-04-30T16:06:45Z")

</div>

This is awesome Simon 👏👏👏🙌🙌🙌

I’m looking forward to Makie-driven web apps 👍😊
