how to get parent directory in node js code example Example: get dirname to last directory node path.basename(path.dirname(filename))