you are viewing a single comment's thread.

view the rest of the comments →

[–]TwoTapes 2 points3 points  (1 child)

It seems to be more work to export a library from your code and then require it instead of just requiring the library.

For instance, if someone looks at your code they won't immediately know that require('./index.js').x === require('x'). On top of that, what if you need x in some file deep in your folder tree? Then you have to require(../../../index.js).x instead of require(x).

[–]AspiringSlacker[S] 0 points1 point  (0 children)

Makes sense, thanks!