1.0.0 • Published 10 months ago

grdp v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

grdp (Get Root Dir Path)

Retrieve the root directory path of the project, regardless of monorepo.

Installation

npm install grdp

Usage

Default

import getRootDirPath from 'grdp'

const rootDirPath = getRootDirPath(); // => '/Users/username/Projects/project-name'

Monorepo

// 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'
1.0.0

10 months ago