3.2.0 • Published 9 months ago
monorepo-root v3.2.0
monorepo-root
A simple utility to get the monorepo root
Install
# use pnpm
$ pnpm install -D monorepo-root
# use yarn
$ yarn add -D monorepo-root
# use npm
$ npm install -D monorepo-root
Usage
use import
import { monorepoRoot, monorepoRootSync } from '@node-kit/monorepo-root'
monorepoRoot()
// or
monorepoRootSync()
use require
const { monorepoRoot, monorepoRootSync } = require('@node-kit/monorepo-root')
monorepoRoot()
// or
monorepoRootSync()
API reference
- Usage:
monorepoRoot(cwd)
&monorepoRootSync(cwd)
- Parameters:
Param | Description | Type | Optional value | Required | Default value |
---|---|---|---|---|---|
cwd | running path | string | - | false | - |
- Types:
declare function monorepoRoot(cwd?: string): Promise<string | null>
declare function monorepoRootSync(cwd?: string): string | null
- Demos:
- simple use
import { monorepoRoot, monorepoRootSync } from '@node-kit/monorepo-root'
monorepoRoot().then(path => {
console.log('The monorepo root is: ', path) // /Users/user/path/of/package/root or null
})
console.log('The monorepo root is: ', monorepoRootSync()) // /Users/user/path/of/package/root or null
Issues & Support
Please open an issue here.
License
3.2.0
9 months ago
3.0.0-beta.3
10 months ago
3.0.0-beta.2
10 months ago
3.0.0-beta.5
10 months ago
3.0.0-beta.4
10 months ago
3.1.1
10 months ago
3.1.0
10 months ago
3.0.0
10 months ago
2.5.0
1 year ago
2.4.0
1 year ago
2.5.1
1 year ago
2.3.0
1 year ago
2.2.1
1 year ago
2.2.0
1 year ago
2.1.0
1 year ago
2.0.0
1 year ago
2.0.0-beta.1
1 year ago
1.3.4
1 year ago
1.3.3
1 year ago
1.3.2
1 year ago
1.3.1
1 year ago
1.3.0
1 year ago
1.3.0-beta.1
1 year ago
1.2.1
1 year ago
1.2.0
1 year ago
1.1.0
1 year ago
1.0.0-alpha.8
1 year ago
1.0.0-alpha.7
1 year ago
1.0.0-alpha.6
1 year ago
1.0.0-alpha.0
1 year ago
1.0.0
1 year ago