5 ms·
The reason is not correct. Nodejs cache the require lot and so circular dependencies can work without returning half finished loads.
by dsun179 6y ago
The reason is not correct. Nodejs cache the require lot and so circular dependencies can work without returning half finished loads.
- foreigner 6y agoNodejs does cache the results of require(), but that doesn't help with this problem. Example: https://repl.it/repls/SwiftOlivedrabBrace https://repl.it/repls/SwiftOlivedrabBrace