0.0.8 • Published 7 years ago

mono-root v0.0.8

Weekly downloads
30
License
-
Repository
github
Last release
7 years ago

🥕 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.