Skip to main content

pkg-dir

v9.0.0HIGH Risk

Find the root directory of a Node.js project or npm package

C60/100
Install Command
npm install pkg-dir
orpnpm add pkg-dir
Typosquat Defense
Authentic Name

No similarity to known typosquatting targets.

Lifecycle Scripts
Clean Execution

Zero preinstall or postinstall arbitrary execution hooks.

License Type
MIT

Permissive open-source license. Safe for enterprise & proprietary software.

Package Specifications

Unpacked Size
4.8 KB
Dependencies
1
Maintainers
1
Last Published
Jun 5, 2025

Direct Dependencies (1)

Free VS Code Extension

Detect Supply Chain Attacks Directly in Your Editor

Get instant CodeLens risk scores, typosquatting warnings, and license audits right inside your package.json file with zero configuration.

Install Dependency Risk Lens

Frequently Asked Questions

Is pkg-dir safe to use in production?
pkg-dir received a Security Grade of C (60/100) with a risk evaluation of HIGH. It contains zero malicious postinstall scripts.
What license does pkg-dir use?
pkg-dir is licensed under the MIT license (PERMISSIVE). This is a permissive open-source license suitable for commercial applications.
How do I install pkg-dir?
Install it via NPM using: npm install pkg-dir, or via PNPM: pnpm add pkg-dir, or Yarn: yarn add pkg-dir.