nodejitsu/require-analyzer — pull request #57 by fb55 (2012-09-08 22:08:49+00:00)
Title: Refactor

As you might have seen, I did some refactoring in the `refactor` branch. Mainly removing unused code, improving and abstracting some stuff and introducing two new public methods:

- `analyzer.path` does ra's magic on a path, no matter what kind of file is behind it.
- `analyzer.findNextDir` does what `.findModulesDir` did so long: Return the next directory for a path.

`.findModulesDir` now actually searches for a directory containing either a `node_modules` dir or a `package.json` file.

`findit` is no longer a dependency, as `.path` (which is an abstraction of `.dir`) can do the job.

Please have a look at the code, it's possible that I've missed something. (All tests pass at least.)