source: imaps-frontend/node_modules/resolve/test/resolver/nested_symlinks/mylib/async.js

main
Last change on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago

Update repo after prototype presentation

  • Property mode set to 100644
File size: 858 bytes
Line 
1var a = require.resolve('buffer/').replace(process.cwd(), '$CWD');
2var b;
3var c;
4
5var test = function test() {
6 console.log(a, ': require.resolve, preserveSymlinks ' + (process.execArgv.indexOf('preserve-symlinks') > -1 ? 'true' : 'false'));
7 console.log(b, ': preserveSymlinks true');
8 console.log(c, ': preserveSymlinks false');
9
10 if (a !== b && a !== c) {
11 throw 'async: no match';
12 }
13 console.log('async: success! a matched either b or c\n');
14};
15
16require('resolve')('buffer/', { preserveSymlinks: true }, function (err, result) {
17 if (err) { throw err; }
18 b = result.replace(process.cwd(), '$CWD');
19 if (b && c) { test(); }
20});
21require('resolve')('buffer/', { preserveSymlinks: false }, function (err, result) {
22 if (err) { throw err; }
23 c = result.replace(process.cwd(), '$CWD');
24 if (b && c) { test(); }
25});
26
Note: See TracBrowser for help on using the repository browser.