process.mainModule

process.mainModule

Alternate way to retrieve require.main. The difference is that if the main module changes at runtime, require.main might still refer to the original main module in modules that were required before the change occurred. Generally it's safe to assume that the two refer to the same module.

As with require.main, it will be undefined if there was no entry script.

doc_Nodejs
2016-04-30 04:41:17
Comments
Leave a Comment

Please login to continue.