Find the parent directory for top level projects.
- Simple downward search algorithm.
- Useful for operating on multiple projects.
- The end user likely visits here a lot.
npm install code-dir --save
Get it into your program.
const codeDir = ;
Find the directory where the end user stores their projects.
Promise for the path of the topmost project's parent directory. A project is a directory that contains either
Current working directory the search is based on. This is the deepest directory that could be returned. If neither it nor any of its parent directories are projects, then as a last resort, its children are checked to determine if any of them are projects, in case the working directory itself is the code directory, since that is a common case.
See our contributing guidelines for more details.
- Fork it.
- Make a feature branch:
git checkout -b my-new-feature
- Commit your changes:
git commit -am 'Add some feature'
- Push to the branch:
git push origin my-new-feature
- Submit a pull request.
Go make something, dang it.