Skip to content
JS
Package

pkg-dir

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

v9.0.0, 5 Jun 2025MITESM onlyTypes: Bundled
$ npm install pkg-dir
Deprecated on npm
Renamed to `package-directory`.

Key numbers

As of 25 Sept 2026
Weekly downloads
71.7m
+7% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
1
Direct, from package.json
Last release
1 year ago
v9.0.0
GitHub stars
253
21 forks
Open issues / PRs
0 / 0
Contributors
9
Commits, last 52 weeks
3

Downloads

Last week 2026-09-15 to 2026-09-21
025m50m75m100mSept 2025Mar 2026Sept 2026High 90.8m (25 Aug 2026)Low 33.1m (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

71,736,496 downloads last week, 309,254,785 in the last month. The 12-month change of +7% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
012 in total
Latest version
9.0.0, 5 Jun 20251 year ago
First published
1 Sept 2015
Last push to GitHub
18 Sept 20266 days before the snapshot
Repository archived
No
Open issues
0
Open pull requests
0
Commits, last 52 weeks
3
Dependents on npm
-

Major versions

  1. v9 first release 9.0.0, 5 Jun 2025
  2. v8 first release 8.0.0, 3 Nov 2023
  3. v7 first release 7.0.0, 16 Aug 2022
  4. v6 first release 6.0.0, 2 Oct 2021
  5. v5 first release 5.0.0, 16 Oct 2020
  6. v4 first release 4.0.0, 12 Mar 2019
  7. v3 first release 3.0.0, 18 Jun 2018
  8. v2 first release 2.0.0, 4 May 2017
  9. v1 first release 1.0.0, 1 Sept 2015

Recent releases

VersionPublished
9.0.05 Jun 2025
8.0.03 Nov 2023
7.0.016 Aug 2022
6.0.16 Oct 2021
6.0.02 Oct 2021
5.0.016 Oct 2020
4.2.021 May 2019
4.1.05 Apr 2019
4.0.012 Mar 2019
3.0.018 Jun 2018
2.0.04 May 2017
1.0.01 Sept 2015
Module format
ESM onlyFrom package.json type, main and exports fields
TypeScript types
Bundled
Node.js engine range
>=18
Runtimes
-
Unpacked size (npm)
4.8 kB
Dependencies (1)
find-up-simple
npm install pkg-dir
  • jsDelivrhttps://cdn.jsdelivr.net/npm/pkg-dir@9.0.0/
  • unpkghttps://unpkg.com/pkg-dir@9.0.0/
  • esm.shhttps://esm.sh/pkg-dir@9.0.0
Sources: npm registry, npm downloads API, GitHub API. Data fetched 25 Sept 2026.

Indexability: Not indexed (discovery only): deprecated; no category.