I want to experiment with calling a javascript libraries’ functions to get a small subset of functionality to eventually plug into my OTP application. My first instinct is to create a script that installs the dependencies via npm and then just put the functions that I need in scripts that i can execute with System.cmd or another library like porcelain just execute the functions I need by passing node scripts/somefunction.js
and getting the output to process. This would probably just work for strings but the library I’d like to use may return nested json objects or arrays. What would be the best way to
- Call the commands and get elixir datatype equivalents for the output
- Package it in a way that I just need a mix command to install it along with deps.get (the package, not node itself)