You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
606 B

2 years ago
  1. var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
  2. var b = require('resolve').sync('buffer/', { preserveSymlinks: true }).replace(process.cwd(), '$CWD');
  3. var c = require('resolve').sync('buffer/', { preserveSymlinks: false }).replace(process.cwd(), '$CWD');
  4. console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
  5. console.log(b, ': preserveSymlinks true');
  6. console.log(c, ': preserveSymlinks false');
  7. if (a !== b && a !== c) {
  8. throw 'sync: no match';
  9. }
  10. console.log('sync: success! a matched either b or c\n');