We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
sindresorhus
Learn more about funding links in repositories.
Report abuse
1 parent a1006db commit 6570506Copy full SHA for 6570506
index.js
@@ -1,12 +1,12 @@
1
import path from 'node:path';
2
import {findUp, findUpSync} from 'find-up';
3
4
-export async function packageDirectory({cwd}) {
+export async function packageDirectory({cwd} = {}) {
5
const filePath = await findUp('package.json', {cwd});
6
return filePath && path.dirname(filePath);
7
}
8
9
-export function packageDirectorySync({cwd}) {
+export function packageDirectorySync({cwd} = {}) {
10
const filePath = findUpSync('package.json', {cwd});
11
12
0 commit comments