Skip to content

Use child_process node instead of require for cozy-konnector-dev #700

@ptbrowne

Description

@ptbrowne

Since cozy-konnector-dev uses require to "launch" a konnectors' code, require.main === module is false, preventing the use of the if (require.main === module) { main().catch(e => {...}) } technique to prevent the execution of code when importing the file (can be useful to test service functions without splitting the service into a "runnable" file and a "utilify" file). See https://mattermost.cozycloud.cc/cozycloud/pl/1ms91mf3f7rnmcagfymqw45j1c for more context.

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