javascript - NodeJS - convert relative path to absolute -
in file-system working directory here:
c:\temp\a\b\c\d
and under b\bb there's file: tmp.txt
c:\temp\a\b\bb\tmp.txt
if want go file working directory, i'll use path:
"../../bb/tmp.txt"
in case file not exist want log full path , tell user:
"the file c:\temp\a\b\bb\tmp.txt not exist".
my question:
i need function convert relative path: "../../bb/tmp.txt" absolute: "c:\temp\a\b\bb\tmp.txt"
in code should this:
console.log("the file" + converttoabs("../../bb/tmp.txt") + " not exist")
Comments
Post a Comment