diff --git a/.zk/notebook.db b/.zk/notebook.db index 73ff0fc..38525d5 100644 Binary files a/.zk/notebook.db and b/.zk/notebook.db differ diff --git a/zk/NodeJS_scripts.md b/zk/NodeJS_scripts.md index 5a1b669..5b0d203 100644 --- a/zk/NodeJS_scripts.md +++ b/zk/NodeJS_scripts.md @@ -37,3 +37,14 @@ If you use any module not in the Node core, you will need to have this installed globally for it to work. (There are [ways around this](https://thom4.net/2014/self-contained-node-scripts/) for Node scripts you publish but for personal scripts this doesn't matter.) + +## `require.main` + +This construction checks that the script is being directy invoked via the 'node' +command in the terminal rather than called by another module. + +This is equivalent to the [following construct]() in Python: + +```py +if __name__ == "__main__": +```