# Calling javascript libraries from within Julia

**URL:** <https://discourse.julialang.org/t/calling-javascript-libraries-from-within-julia/11053>\
**Category:** General Usage\
**Tags:** question\
**Created:** [May 21, 2018, 5:23pm UTC](https://discourse.julialang.org/t/calling-javascript-libraries-from-within-julia/11053 "2018-05-21T17:23:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![amckay1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amckay1/32/8280_2.png) [@amckay1](https://discourse.julialang.org/u/amckay1)\
**Post date:** [May 21, 2018, 5:23pm UTC](https://discourse.julialang.org/t/calling-javascript-libraries-from-within-julia/11053/1 "2018-05-21T17:23:43Z")

</div>

So I’ve used PyCall very successfully for calling python packages, but how would people suggest calling and working with javascript from within Julia? JSExpr.jl and WebIO.jl look promising, but if I want to import a library and execute js code immediately, not in the context of any event or UI, I wasn’t sure how that would be done and then the result returned to Julia (maybe that last part using the Scope object?).

Trying to go for the Pan Julian approach for my code 🙂 I’m not a javascript dev by any means, so hopefully this is me just misunderstanding something simple. Thank you for your help!

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [May 21, 2018, 6:37pm UTC](https://discourse.julialang.org/t/calling-javascript-libraries-from-within-julia/11053/2 "2018-05-21T18:37:45Z")

</div>

One option might be [https://github.com/davidanthoff/NodeJS.jl](https://github.com/davidanthoff/NodeJS.jl). It is not even close to being slick, but it does allow you to run JavaScript code in a node process.

In an ideal world NodeJS.jl would actually embed node and provide a tighter integration. One could imagine a version that ships a shared library version of node via BinaryProvider etc. I won’t have time to do any of that, but if some brave soul wants to tackle that, it would be most welcome.

---

<div class="post-metadata">

**Author:** ![amckay1](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/amckay1/32/8280_2.png) [@amckay1](https://discourse.julialang.org/u/amckay1)\
**Post date:** [May 21, 2018, 7:04pm UTC](https://discourse.julialang.org/t/calling-javascript-libraries-from-within-julia/11053/3 "2018-05-21T19:04:31Z")

</div>

Still slicker than my approach so far, thank you! I wish I was the brave/knowledgeable soul to tighten that integration, but I’ll need to learn more first.

I’ll keep exploring and report back if anything seems useful to the larger group 🙂
