toddself/repl-it — pull request #3 by eush77 (2014-09-28 14:41:21+00:00)
Title: Search for package.json up the directory tree

It would be nice not to have to start the REPL strictly from the package root, just like you can `npm install` or `npm ls` from any nested subdirectory.

I found that the algorithm NPM uses to traverse up to the root directory is [implemented](https://github.com/npm/npmconf/blob/master/lib/find-prefix.js) in [npmconf](https://www.npmjs.org/package/npmconf), but this module seems to do a dozen of other things, so I ended up using [pkginfo](https://www.npmjs.org/package/pkginfo) to [locate the package root](https://github.com/indexzero/node-pkginfo/blob/eeabe7e9c0c2c66fe6daf663b4d02bf41304a6ca/lib/pkginfo.js#L90-109). Unfortunately, it is still not focused enough, let me know if you know a better option.