I would like to use require() in my task body. I have found a way to hack this capability by adding...
require: require
to https://github.com/joyent/node-workflow/blob/58715e9835d80156370035354143acb2add92c86/lib/task-runner.js#L53
This allows me to use require() relative to the task-runner.js file of the wf module. Including a script from my project root would be require('../../../thescript')
I had to modify the source of this module to get require to work properly because specifying require: require in the runner sandbox modules config doesn't work.
I understand that the use of vm is for security purposes but is there a safe way to allow the use of require in task body? Perhaps allow the user to specify require in runner config with a disclaimer that doing so would lower safety?
I would like to use require() in my task body. I have found a way to hack this capability by adding...
require: requireto https://github.com/joyent/node-workflow/blob/58715e9835d80156370035354143acb2add92c86/lib/task-runner.js#L53
This allows me to use
require()relative to the task-runner.js file of the wf module. Including a script from my project root would berequire('../../../thescript')I had to modify the source of this module to get require to work properly because specifying
require: requirein the runner sandbox modules config doesn't work.I understand that the use of vm is for security purposes but is there a safe way to allow the use of require in task body? Perhaps allow the user to specify
requirein runner config with a disclaimer that doing so would lower safety?