|
|
|
|
|
by Ginden
1683 days ago
|
|
Eg. module.exports = {foo: 3};
setImmediate(() => module.exports[Math.random() > 0.5 ? 'foo' : 'bar'] = 5);
This is impossible for ES modules, because exports are static and known at parse time.Few widely used packages do something like: enhanceWithAdditionalProperties(module.exports, mixin);
|
|
I see these subtle differences, but fail to see how they are a solution to the problem of “doing strange things to exports”.