Retrieve the root directory path of the project, regardless of monorepo.
npm install grdp
import getRootDirPath from 'grdp'
const rootDirPath = getRootDirPath(); // => '/Users/username/Projects/project-name'
// repo1/some/path/file.js
import rootDirPath from 'grdp'
const monorepoRootDirPath = getRootDirPath(); // => '/Users/username/Projects/monorepo/repo1'
// repo2/some/path/file.js
import rootDirPath from 'grdp'
const monorepoRootDirPath = getRootDirPath(); // => '/Users/username/Projects/monorepo/repo2'