Socket
Book a DemoInstallSign in
Socket

@node-kit/pnpm-workspace-root

Package Overview
Dependencies
Maintainers
1
Versions
35
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@node-kit/pnpm-workspace-root

A simple utility to get the pnpm workspace root

3.3.1
latest
Source
npmnpm
Version published
Weekly downloads
28K
-10.96%
Maintainers
1
Weekly downloads
 
Created
Source

@node-kit/pnpm-workspace-root

A simple utility to get the pnpm workspace root

NPM version Codacy Badge Test coverage npm download License

Sonar

Install

# use pnpm
$ pnpm install -D @node-kit/pnpm-workspace-root

# use yarn
$ yarn add -D @node-kit/pnpm-workspace-root

# use npm
$ npm install -D @node-kit/pnpm-workspace-root

Usage

use import

import { pnpmWorkspaceRoot, pnpmWorkspaceRootSync } from '@node-kit/pnpm-workspace-root'

pnpmWorkspaceRoot()
// or
pnpmWorkspaceRootSync()

use require

const { pnpmWorkspaceRoot, pnpmWorkspaceRootSync } = require('@node-kit/pnpm-workspace-root')

pnpmWorkspaceRoot()
// or
pnpmWorkspaceRootSync()

API reference

  • Usage: pnpmWorkspaceRoot(cwd) & pnpmWorkspaceRootSync(cwd)
  • Parameters:
ParamDescriptionTypeOptional valueRequiredDefault value
cwdrunning pathstring-false-
  • Types:
declare function pnpmWorkspaceRoot(cwd?: string): Promise<string | null>

declare function pnpmWorkspaceRootSync(cwd?: string): string | null
  • Demos:
  • simple use
import { pnpmWorkspaceRoot, pnpmWorkspaceRootSync } from '@node-kit/pnpm-workspace-root'

pnpmWorkspaceRoot().then(path => {
  console.log('The pnpm workspace root is: ', path) // /Users/user/path/of/package/root or null
})
console.log('The pnpm workspace root is: ', pnpmWorkspaceRootSync()) // /Users/user/path/of/package/root or null

Issues & Support

Please open an issue here.

License

MIT

Keywords

node-kit

FAQs

Package last updated on 26 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.