strongloop/strong-supervisor — pull request #13 by rmg (2014-03-19 08:21:51+00:00)
Title: Look for package.json to determine app root

Currently when given a path to a file such as in
`sl-run path/to/some/app.js` the behaviour is to mimic
`cd path/to/some && node app.js`.

Since normal `npm start` behaviour is to cd into the package's root, it
is desirable to look for the `package.json` nearest to the given app.js
and chdir into that directory, using the original behaviour as a
fallback when not `package.json` can be found.

Given that these paths exist:
```
path/package.json
path/to/some/app.js
```

`sl-run path/to/some/app.js` should do `cd path && node to/some/app.js`