INNER CODE UNIT · JavaScript
allModulePaths
tunnckoCore/opensource · @packages/all-module-paths/src/index.js:10
export default function allModulePaths(options = {}) {
const { paths } = { paths: [], ...options };
assert(Array.isArray(paths), 'expect options.paths to be string[]');
const pnpmStoreVersions = ['3', '2', '1'].map((x) =>
path.join('pnpm-global', String(x), 'node_modules'),
);
/**
* GLOBAL
*/
// Maximum up to the home directory
const globalPaths = mod.globalPaths
.filter((x) => x.startsWith(HOMEDIR))
// ?? removing pnpm stuff from globalPaths, we later adding it again