Name your anonymous functions to `dive()` so it's more clear what is happening.  Better yet, do this:

```javascript
function recurse(path) {
  ...
  function onSuccess(..){
    ...
  };
  function onError(..){
    ...
  };
  dive(path, onSuccess, onError);
}
```
I'm just guessing that this is what those do, but that's the pattern.  It's easier to understand the code this way without knowing how dive works internally.