JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 1
  • Score
    100M100P100Q15703F
  • License MIT

A simple utility to get the workspace root

Package Exports

  • @node-kit/workspace-root
  • @node-kit/workspace-root/index

Readme

@node-kit/workspace-root

A simple utility to get the workspace root

NPM version Codacy Badge Test coverage License

Sonar

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-root

Usage

  1. use @node-kit/workspace-root in 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
})
  1. use @node-kit/workspace-root in sync mode
import { workspaceRootSync } from '@node-kit/workspace-root'

console.log('The workspace root is: ', workspaceRootSync()) // /Users/user/path/of/package/root or null

Issues & Support

Please open an issue here.

License

MIT