node get path from base directory code example Example: get dirname to last directory node path.basename(path.dirname(filename))