// Extract only the file name.
// Replace File name with lowercase.
// Replace whitespaces with underscores.
let filename = "c:\\path\\to\\file\\WITH Whitespace1 and Whitespace2.js";
filename = filename.replace(/^.*[\\\/]([^\\\/]*)$/i,"$1");
filename = filename.replace(/\s/g,"_");
filename = filename.toLowerCase();
console.log(filename);
/*
run:
with_whitespace1_and_whitespace2.js
*/