The module.parent
is now deprecated in Node.js. As an alternative, require.main
should be used. To update your code, just change the following line:
- if (module.parent) {
+ if (require.main !== module) {
If // @ts-ignore
was used to suppress an error, you can delete it.