pkg-dir
Advanced tools
Comparing version 4.2.0 to 5.0.0
declare const pkgDir: { | ||
/** | ||
Synchronously find the root directory of a Node.js project or npm package. | ||
@param cwd - Directory to start from. Default: `process.cwd()`. | ||
@returns The project root path or `undefined` if it couldn't be found. | ||
*/ | ||
sync: (cwd?: string) => string | undefined; | ||
/** | ||
Find the root directory of a Node.js project or npm package. | ||
@@ -31,15 +39,4 @@ | ||
(cwd?: string): Promise<string | undefined>; | ||
/** | ||
Synchronously find the root directory of a Node.js project or npm package. | ||
@param cwd - Directory to start from. Default: `process.cwd()`. | ||
@returns The project root path or `undefined` if it couldn't be found. | ||
*/ | ||
sync(cwd?: string): string | undefined; | ||
// TODO: Remove this for the next major release | ||
default: typeof pkgDir; | ||
}; | ||
export = pkgDir; |
@@ -11,4 +11,2 @@ 'use strict'; | ||
module.exports = pkgDir; | ||
// TODO: Remove this for the next major release | ||
module.exports.default = pkgDir; | ||
@@ -15,0 +13,0 @@ module.exports.sync = cwd => { |
{ | ||
"name": "pkg-dir", | ||
"version": "4.2.0", | ||
"version": "5.0.0", | ||
"description": "Find the root directory of a Node.js project or npm package", | ||
@@ -10,6 +10,6 @@ "license": "MIT", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
"url": "https://sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
"node": ">=10" | ||
}, | ||
@@ -49,10 +49,10 @@ "scripts": { | ||
"dependencies": { | ||
"find-up": "^4.0.0" | ||
"find-up": "^5.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tempy": "^0.3.0", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
"ava": "^2.4.0", | ||
"tempy": "^1.0.0", | ||
"tsd": "^0.13.1", | ||
"xo": "^0.33.1" | ||
} | ||
} |
@@ -1,6 +0,5 @@ | ||
# pkg-dir [![Build Status](https://travis-ci.org/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.org/sindresorhus/pkg-dir) | ||
# pkg-dir [![Build Status](https://travis-ci.com/sindresorhus/pkg-dir.svg?branch=master)](https://travis-ci.com/github/sindresorhus/pkg-dir) | ||
> Find the root directory of a Node.js project or npm package | ||
## Install | ||
@@ -12,3 +11,2 @@ | ||
## Usage | ||
@@ -39,10 +37,9 @@ | ||
## API | ||
### pkgDir([cwd]) | ||
### pkgDir(cwd?) | ||
Returns a `Promise` for either the project root path or `undefined` if it couldn't be found. | ||
### pkgDir.sync([cwd]) | ||
### pkgDir.sync(cwd?) | ||
@@ -53,3 +50,3 @@ Returns the project root path or `undefined` if it couldn't be found. | ||
Type: `string`<br> | ||
Type: `string`\ | ||
Default: `process.cwd()` | ||
@@ -59,3 +56,2 @@ | ||
## Related | ||
@@ -67,5 +63,12 @@ | ||
--- | ||
## License | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) | ||
<div align="center"> | ||
<b> | ||
<a href="https://tidelift.com/subscription/pkg/npm-pkg-dir?utm_source=npm-pkg-dir&utm_medium=referral&utm_campaign=readme">Get professional support for this package with a Tidelift subscription</a> | ||
</b> | ||
<br> | ||
<sub> | ||
Tidelift helps make open source sustainable for maintainers while giving companies<br>assurances about security, maintenance, and licensing for their dependencies. | ||
</sub> | ||
</div> |
Sorry, the diff of this file is not supported yet
4983
70
45
+ Addedfind-up@5.0.0(transitive)
+ Addedlocate-path@6.0.0(transitive)
+ Addedp-limit@3.1.0(transitive)
+ Addedp-locate@5.0.0(transitive)
+ Addedyocto-queue@0.1.0(transitive)
- Removedfind-up@4.1.0(transitive)
- Removedlocate-path@5.0.0(transitive)
- Removedp-limit@2.3.0(transitive)
- Removedp-locate@4.1.0(transitive)
- Removedp-try@2.2.0(transitive)
Updatedfind-up@^5.0.0