-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy path4-cache.js
More file actions
15 lines (13 loc) · 466 Bytes
/
Copy path4-cache.js
File metadata and controls
15 lines (13 loc) · 466 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
'use strict';
const ex1 = require('./1-export.js');
const modulePath = require.resolve('./1-export.js');
console.log({ required: modulePath });
console.log(require.cache[modulePath]);
delete require.cache[modulePath];
console.log({ cached: require.cache[modulePath] });
const ex2 = require('./1-export.js');
console.log(ex1 === ex2);
const ws = require('ws');
const wsPath = require.resolve('ws');
console.log(ws, wsPath);
console.log(Object.keys(require.cache));