My trusted reviewers, please take a look

//cc @lemmy- @dmikis @tarmolov
Here shorter implementation:

```javascript
var currentPath = startDirName;
while (currentPath !== '/') {
    /* do something with currentPath */
    currentPath = path.resolve(path.join(currentPath, '..'));
}
```