Skip to content

allowing use of require() in tasks #154

@TomKaltz

Description

@TomKaltz

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions