Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Whats the difference between os.tmpDir & os.tmpdir?

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

like image 471
powercoder23 Avatar asked May 06 '14 12:05

powercoder23


People also ask

What is os tmpdir?

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.

What are the requirements to set Priority_highest priority to a process with the OS Setpriority method?

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).

Which of the following code returns the hostname of the operating system?

hostname() # Returns the host name of the operating system as a string.

Is node JS platform independent?

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.


1 Answers

They are the same. Check the source

For reference, the code is:

exports.tmpDir = exports.tmpdir;

Btw: It's a method, not a property.

like image 170
NilsH Avatar answered Oct 04 '22 13:10

NilsH