You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Find a Node module/file given its name in a specific directory, with a fallback to the current working directory.
43
+
* If the name is empty, return undefined.
44
+
* Try to resolve the module/file using require.resolve with the specified directory as the starting point.
45
+
* Return the resolved path if successful, otherwise return undefined.
46
+
*
47
+
* @export
48
+
* @param {string} name The name of the module/file to find
49
+
* @param {string} [cwd=process.cwd()]
50
+
* @returns {*} Finds a specified module or file using require.resolve starting from a specified directory path, or the current working directory if not provided.
@@ -106,7 +130,7 @@ export function ensurePackage(
106
130
}
107
131
108
132
/**
109
-
* A function that searches for the nearest package.json file starting from the provided search path or the current working directory if no search path is provided.
133
+
* A function that searches for the nearest package.json file starting from the provided search path or the current working directory if no search path is provided.
110
134
* It iterates through the directory structure going one level up at a time until it finds a package.json file. If no package.json file is found, it returns undefined.
0 commit comments