Home
Docs
GitHub
Pricing
Blog
Log In

Run Sandworm Audit for your App

Get started
Hold on, we're currently generating a fresh version of this report
Generated on May 3, 2024 via pnpm
Package summary
Share
0
issues
1
license
7
MIT
Package created
1 Sep 2015
Version published
16 Aug 2022
Maintainers
1
Total deps
7
Direct deps
1
License
MIT

Issues

0
This package has no issues

Licenses

MIT License

Permissive
OSI Approved
This is a human-readable summary of (and not a substitute for) the license. Disclaimer.
Can
commercial-use
modify
distribute
sublicense
private-use
Cannot
hold-liable
Must
include-copyright
include-license
7 Packages, Including:
find-up@6.3.0
locate-path@7.2.0
p-limit@4.0.0
p-locate@6.0.0
path-exists@5.0.0
pkg-dir@7.0.0
yocto-queue@1.0.0
Disclaimer

This deed highlights only some of the key features and terms of the actual license. It is not a license and has no legal value. You should carefully review all of the terms and conditions of the actual license before using the licensed material.

Sandworm is not a law firm and does not provide legal services. Distributing, displaying, or linking to this deed or the license that it summarizes does not create a lawyer-client or any other relationship.

Direct Dependencies

1
All Dependencies CSV
β“˜ This is a list of pkg-dir 's direct dependencies. Data on all dependencies, including transitive ones, is available via CSV download.
NameVersionSizeLicenseTypeVulnerabilities
find-up6.3.04.06 kBMIT
prod

Visualizations

Frequently Asked Questions

What does pkg-dir do?

Pkg-dir is a beneficial npm package that aims at finding the root directory of a Node.js project or npm package.

How do you use pkg-dir?

You can use pkg-dir by installing it first in your Node.js project using the npm package manager with the command npm install pkg-dir. After successful installation, you can import it in your Javascript file and use its functions like packageDirectory or packageDirectorySync. The packageDirectory function returns a promise for the project root path. In case, it can't find the path, a return value of undefined will be given. For instance:

// Import the module
import {packageDirectory} from 'pkg-dir';

// Use the function packageDirectory to get the root path
console.log(await packageDirectory());

If you want to use the synchronous version, you can make use of packageDirectorySync.

Additionally, you can specify the directory to start searching from by passing an options object with 'cwd' property set to your desired directory.

Where are the pkg-dir docs?

The pkg-dir documentations are available on its GitHub page at https://github.com/sindresorhus/pkg-dir. The documentation provides detailed information including installation, usage, and API references along with examples. Moreover, it also recommends related packages that might be of interest. For professional support, they advise getting a Tidelift subscription.