pkg-dir
npmv9.0.0TypeScriptDeprecatedFind the root directory of a Node.js project or npm package
Deprecation notice: Renamed to `package-directory`.
Overview
pkg-dir is a deprecated npm package that find the root directory of a Node.js project or npm package. The latest version is 9.0.0, released under the MIT license.
Who should use it
pkg-dir is deprecated and is best avoided for new projects. Existing users should plan a migration to a maintained alternative.
When not to use it
Do not adopt this package for new work — it is no longer maintained.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- Marked deprecated: Renamed to `package-directory`.
Auto-generated from collected registry metadata. No external claims are inferred.
Relationship graph
Dependencies (left) and dependents (right) of pkg-dir.
Dependencies
Runtime (1)
Dev (4)
Used by
Popular packages that depend on pkg-dir.
Alternatives to pkg-dir
Find a file or directory by walking up parent directories
A tiny (183B to 210B) and fast utility to ascend parent directories
Get the first path that exists on disk of multiple paths
Extract the non-magic parent path from a glob string.
Resolve the path of a module like `require.resolve()` but from the current working directory
Resolve the path of a module like `require.resolve()` but from a given path
Convert an absolute path to a tilde path: `/Users/sindresorhus/dev` → `~/dev`
The fastest directory crawler & globbing alternative to glob, fast-glob, & tiny-glob. Crawls 1m files in < 1s
Get paths for storing things like data, config, cache, etc
Better streaming static file server with Range and conditional-GET support
Stringify your JSON at max speed
Fast and low overhead web framework, for Node.js
Frequently installed together
Version history
| Version | Published | License |
|---|---|---|
| 9.0.0latest | 1 year ago | MIT |
| 8.0.0 | 2 years ago | MIT |
| 7.0.0 | 3 years ago | MIT |
| 6.0.1 | 4 years ago | MIT |
| 6.0.0 | 4 years ago | MIT |
| 5.0.0 | 5 years ago | MIT |
| 4.2.0 | 7 years ago | MIT |
| 4.1.0 | 7 years ago | MIT |
| 4.0.0 | 7 years ago | MIT |
| 3.0.0 | 8 years ago | MIT |
| 2.0.0 | 9 years ago | MIT |
| 1.0.0 | 11 years ago | MIT |
Maintainers
Funding
Frequently asked questions
How do I install pkg-dir?
Run `npm install pkg-dir` to add pkg-dir to your npm project.
What license is pkg-dir released under?
pkg-dir is distributed under the MIT license.
How popular is pkg-dir?
pkg-dir has approximately 0 downloads per week and 1 known dependent packages.
Is pkg-dir still maintained?
pkg-dir is marked as deprecated: Renamed to `package-directory`.. Consider a maintained alternative for new projects.