project-dirs
v0.2.0
Published
Get a list of paths to all of your projects
Downloads
6
Maintainers
Readme
project-dirs
Get a list of paths to all of your projects.
Why?
- Useful for development scripts to automate your work.
- Makes a good starting point to find other paths.
- Works even within nested projects.
Install
npm install project-dirs --save
Usage
Get it into your program.
const projectDirs = require('project-dirs');
Display the location of all top level projects.
projectDirs().then((dirs) => {
dirs.forEach((dir) => {
console.log('Project path:', dir);
});
});
API
projectDirs(cwd)
Returns an Array
of paths for the topmost projects within your code directory.
cwd
Type: string
Default: process.cwd()
The directory of a project or one of its descendants, marking where to end the downwards search for projects.
Related
- code-dir - Find the parent directory for top level projects
Contributing
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.
License
Go make something, dang it.