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