Created
November 24, 2021 14:20
-
-
Save mmoehrlein/b9104e25d535cd809cf54f9ddbd156fc to your computer and use it in GitHub Desktop.
js if statement to check if file is run directly or required by something else
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // if executed directly, start the main function | |
| if (require.main === module) { | |
| main(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment