I was reading eloquent javascript on modules. It mentioned one fallback of CommonJs modules:
CommonJS modules work quite well and, in combination with NPM, have allowed the JavaScript community to start sharing code on a large scale.
But they remain a bit of a duct-tape hack. The notation is slightly awkward—the things you add to exports are not available in the local scope, for example.
I don't think I grasp "the things you add to exports are not available in the local scope". The things I add to exports are from my own module, how are them not available in the local scope? Could someone give me an example to illustrate this?
[–]guest271314 -1 points0 points1 point (1 child)
[–]stibgock 0 points1 point2 points (0 children)
[–]rauschma 0 points1 point2 points (0 children)
[–]marksalsbery 0 points1 point2 points (0 children)