shared
utils
string
object
is
extension
js
tracking
string
dom
when
selection
position
iframe
event
scroll
console
node
string
project
fs
console
packageRootDir
Type:Function
Status:beta
Since:1.0.0
Platform:node
@blackbyte.sugar.node.path
Return the path to either the first finded package root going up the folders, or the highest package root finded
Params
- from”process.cwd()“String
Specify from where the research has to be done
- settings{}Boolean
Some settings to configure the research
Return
- -String
The finded package path or false if not finded
Example
import { packageRootDir } from '@blackbyte/sugar/path';
const root = packageRootDir();Settings
- highestfalseBoolean
Specify if you want the highest package possible
- upCount*-Number
Specify a number of packages to go up. Cannot be used alongside the
highestsetting - requiredProperties[‘name’,‘version’]String[]
Specify some required properties that MUST be present in the package.json to be considered as a valid package
Author
- Olivier Bosselolivier.bossel@gmail.comhttps://blackbyte.space