project-dirs

0.2.0 • Public • Published

project-dirs Build status for 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.

  1. Fork it.
  2. Make a feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request.

License

MPL-2.0 © Seth Holladay

Go make something, dang it.

Package Sidebar

Install

npm i project-dirs

Weekly Downloads

3

Version

0.2.0

License

MPL-2.0

Last publish

Collaborators

  • sholladay