Package Exports
- mono-root
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mono-root) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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.