Added functionality for temporary file creation using tmpDir option to prevent exposing credentials to process list