Closed kdiogenes closed 5 months ago
Hey,
I'm not much versed in JavaScript, but I think that this can be a good solution:
#{source} try { const args = #{args} Promise.resolve(#{func}(...args)).then(result => { const output = JSON.stringify(['ok', result, []]) process.stdout.write(output) }) } catch (err) { process.stdout.write(JSON.stringify(['err', '' + err, err.stack])) }
I will write a PR with it, just would like to open the discussion.
Best regards!
Just created a PR: https://github.com/bridgetownrb/node-runner/pull/3
Thanks @kdiogenes!
Hey,
I'm not much versed in JavaScript, but I think that this can be a good solution:
I will write a PR with it, just would like to open the discussion.
Best regards!