nodejs get directory name and go one sep back code example Example: get dirname to last directory node path.basename(path.dirname(filename))