executor v0.0.3 Executor.Node

This module is responsible for executing node code.

Summary

Functions

Generates the script to execute Node code. Code is rescued on error Deliminators are placed in to aid in capturing results

Returns Node specific name for temporary script file

Returns the result map for the given Node code

Functions

code_template(code)

Generates the script to execute Node code. Code is rescued on error Deliminators are placed in to aid in capturing results

new_file_name()

Returns Node specific name for temporary script file

run(code)

Returns the result map for the given Node code

iex> run(“console.log(‘i kind of like that it does this’); 1 / 0”) {:ok, %{return: “Infinity”, stdout: “i kind of like that it does this”}}