Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
ptbrowne opened this issue Aug 12, 2020 · 0 comments
Open

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

ptbrowne opened this issue Aug 12, 2020 · 0 comments

Comments

@ptbrowne
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant