Lines Matching refs:paths

398 // Given a module name, and a list of paths to test, returns the first
605 * @param {Array<string>} paths Folders to search as file paths
609 Module._findPath = function(request, paths, isMain) {
612 paths = [''];
613 } else if (!paths || paths.length === 0) {
617 const cacheKey = request + '\x00' + ArrayPrototypeJoin(paths, '\x00');
656 for (let i = 0; i < paths.length; i++) {
658 const curPath = paths[i];
734 * Get the paths to the `node_modules` folder for a given path.
754 const paths = [];
767 paths,
782 return paths;
786 * Get the paths to the `node_modules` folder for a given path.
802 const paths = [];
808 paths,
823 // Append /node_modules to handle root paths.
824 ArrayPrototypePush(paths, '/node_modules');
826 return paths;
831 * Get the paths for module resolution.
841 // Check for node modules paths.
849 let paths;
850 if (parent?.paths?.length) {
851 paths = ArrayPrototypeSlice(modulePaths);
852 ArrayPrototypeUnshiftApply(paths, parent.paths);
854 paths = modulePaths;
857 debug('looking for %j in %j', request, paths);
858 return paths.length > 0 ? paths : null;
1052 * @property {string[]} paths Paths to search for modules in
1059 let paths;
1062 if (ArrayIsArray(options.paths)) {
1069 paths = options.paths;
1073 paths = [];
1075 for (let i = 0; i < options.paths.length; i++) {
1076 const path = options.paths[i];
1077 fakeParent.paths = Module._nodeModulePaths(path);
1081 if (!ArrayPrototypeIncludes(paths, lookupPaths[j])) {
1082 ArrayPrototypePush(paths, lookupPaths[j]);
1087 } else if (options.paths === undefined) {
1088 paths = Module._resolveLookupPaths(request, parent);
1090 throw new ERR_INVALID_ARG_VALUE('options.paths', options.paths);
1093 paths = Module._resolveLookupPaths(request, parent);
1120 (paths.length === 1 ? paths[0] : ArrayPrototypeJoin(paths, '\x00'));
1126 const filename = Module._findPath(request, paths, isMain);
1195 this.paths = Module._nodeModulePaths(path.dirname(filename));
1480 m.paths = Module._nodeModulePaths(m.path);
1515 * Define the paths to use for resolving a module.
1527 const paths = [path.resolve(prefixDir, 'lib', 'node')];
1530 ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_libraries'));
1531 ArrayPrototypeUnshift(paths, path.resolve(homeDir, '.node_modules'));
1535 ArrayPrototypeUnshiftApply(paths, ArrayPrototypeFilter(
1541 modulePaths = paths;
1561 parent.paths = Module._nodeModulePaths(process.cwd());