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
* A function that finds a file within the node_modules directory by the provided name.
42
-
* It first searches for the node_modules directory using the findUp function, and if not found, returns undefined.
43
-
* It then splits the provided name into folder and file parts.
44
-
* It finds the location of the folder in the node_modules directory by checking for its existence.
45
-
* If the folder is not found, it returns undefined.
46
-
* It then constructs the file location by joining the folder location and the file name with a '.zmodel' extension if the file does not already have an extension.
47
-
* Returns the file location if it exists, otherwise returns undefined.
42
+
* 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.
48
46
*
49
47
* @export
50
-
* @param name A string representing the name of the file to find in the node_modules folder
51
-
* @returns Path to a specific file within the node_modules directory
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.
0 commit comments