mono-root
v0.0.8
Published
find the root path in monorepos
Downloads
41
Maintainers
Readme
🥕 mono-root
find the root path in monorepos
simple
const {resolve} = require('path')
const monoRoot = require('mono-root')()
const pkg = resolve(monoroot, './package.json')
console.log(pkg)
advanced
- the max
depth
it goes up can be customized - and it can be returned as an object (
asObj
) to see the paths it used
const {resolve} = require('path')
const monoRoot = require('mono-root')
const {
nearest,
farthest,
attempt,
found,
} = monoRoot({depth: 4, asObj: true})
more
- see fliphub-resolve for more verbose use that resolves objects, arrays, with multiple scopes.