I am getting three arguments in my callback, filePath, stat and name. I need to form a object out of it before passing it to my async function.
var config = {};
walk('directory', function(filePath, stat, name) {
console.log("filePath", filePath);
config.input = filePath;
config["output"] = path.join("json", name + ".json");
});
Below is the output:
FilePath: word\file1.doc
{ input: 'word\\file1.doc', output: 'json\\file1.doc.json' }
FilePath: word\file2.doc
{ input: 'word\\file2.doc', output: 'json\\file2.doc.json' }
Why is there a \ getting appended in my object? Though my FilePath has only a single slash.