I was exploring the default OS npm in node their is a 2 properties with their same name one with lowercase (tmpdir) and other in camelcase (tmpDir). When i did a console log i see the same result.
So, Whats the difference between os.tmpDir & os.tmpdir in node? Any specific purpose?
Thanks Dhiraj Gupta
The os. tmpdir() method is an inbuilt application programming interface of the os module which is used to get path of default directory for temporary files of the operating system.
priority: It is a required parameter. It specifies the priority to be set for the process specified process id. Value of this parameter must be between -20(Highest) to 19(Lowest).
hostname() # Returns the host name of the operating system as a string.
Node. js is an open-source, cross-platform, back-end JavaScript runtime environment that runs on a JavaScript Engine (i.e. V8 engine) and executes JavaScript code outside a web browser, which was designed to build scalable network applications.
They are the same. Check the source
For reference, the code is:
exports.tmpDir = exports.tmpdir;
Btw: It's a method, not a property.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With