REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 1.22 KB
Close
/home/byroehnu/.trash/node_modules11/pkg-dir/readme.md
Text
Base64
# pkg-dir [](https://travis-ci.org/sindresorhus/pkg-dir) > Find the root directory of a Node.js project or npm package ## Install ``` $ npm install pkg-dir ``` ## Usage ``` / └── Users └── sindresorhus └── foo ├── package.json └── bar ├── baz └── example.js ``` ```js // example.js const pkgDir = require('pkg-dir'); (async () => { const rootDir = await pkgDir(__dirname); console.log(rootDir); //=> '/Users/sindresorhus/foo' })(); ``` ## API ### pkgDir([cwd]) Returns a `Promise` for either the project root path or `null` if it couldn't be found. ### pkgDir.sync([cwd]) Returns the project root path or `null`. #### cwd Type: `string`<br> Default: `process.cwd()` Directory to start from. ## Related - [pkg-dir-cli](https://github.com/sindresorhus/pkg-dir-cli) - CLI for this module - [pkg-up](https://github.com/sindresorhus/pkg-up) - Find the closest package.json file - [find-up](https://github.com/sindresorhus/find-up) - Find a file by walking up parent directories ## License MIT © [Sindre Sorhus](https://sindresorhus.com)
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 1 × Files: 4
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
node_modules
DIR
-
drwxr-xr-x
2026-02-28 00:26:18
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
297 B
lrw-r--r--
2026-02-28 00:26:42
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
license
1.08 KB
lrw-r--r--
2026-02-28 00:26:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
767 B
lrw-r--r--
2026-02-28 00:26:32
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
readme.md
1.22 KB
lrw-r--r--
2026-02-28 00:27:02
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).