node package manager


NPM version Build Status Dependency Status

Find the working directories of a git repository on a local machine.


$ npm install --save git-working-directory


var git-working-directory = require('git-working-directory');
git-working-directory('adamzr', 'git-working-directory', function(workingCopies){
  console.log(workingCopies);// Will print an array of absolute file paths to working copies of a given git repository 

We search all sub-directories of your home directory looking for all git repositories, then we check the remote origin URL in each one to check if it is a working copy of the repository you are looking for. workingCopies will be an empty array if no working copies are found. This function can take a while to complete if you have a large home directory.


MIT © Adam Richeimer