Basic Ruby to Javascript interop
"XpringCommonJS"
File.expand_path("./javascript/library.js", __dir__)
Yield Returns:
Returns:
17 18 19 20 21 22 23
# File 'lib/xpring/javascript.rb', line 17 def self.run script = prepare(yield) cmd = "node -p #{script.dump}" Xpring.debug_log(cmd) raw = IO.popen(cmd, &:readlines).first&.strip parse(raw) end