Package Exports
- @node-kit/workspace-root
- @node-kit/workspace-root/index
Readme
Install
# use pnpm
$ pnpm install -D @node-kit/workspace-root
# use yarn
$ yarn add -D @node-kit/workspace-root
# use npm
$ npm install -D @node-kit/workspace-rootUsage
- use
@node-kit/workspace-rootin async mode
import { workspaceRoot } from '@node-kit/workspace-root'
workspaceRoot().then(path => {
console.log('The workspace root is: ', path) // /Users/user/path/of/package/root or null
})- use
@node-kit/workspace-rootin sync mode
import { workspaceRootSync } from '@node-kit/workspace-root'
console.log('The workspace root is: ', workspaceRootSync()) // /Users/user/path/of/package/root or nullIssues & Support
Please open an issue here.