tmpdir method of OS module of node.js


Overview

This method is used to get the default directory for temporary files in operating system.
This method returns String . Code snippet is given below :

Code


													
//Name of the file: tmpdir.js
var os = require('os');
var value =  os.tmpdir();
console.log("os.tmpdir() => " + value);		
													
												

Run

  • Now run the snippet using the following command :
    													
    >node tmpdir.js
    os.tmpdir() => C:\Users\acer\AppData\Local\Temp