4 ms·
From a novices perspective, could someone please explain: what is it? what does it do? why is it better than the alternatives? Thanks!
by beginnerly 16y ago
From a novices perspective, could someone please explain: what is it? what does it do? why is it better than the alternatives? Thanks!
- sonnym 16y agoThe CommonJS module specification uses the require() function to include modules. Because this function can take paths, it becomes difficult to share code between the server and the client without some workarounds. What this module does (after a cursory glance) is: 1) intercept the request for browserify.js, 2) package all the necessary modules into a single file along with a require function that will link the modules to their identifiers, and 3) send the file to the client in a way that allows the calling document (in the case of the example, index.html) to use require() and module identifiers client side just as you would on the server side. In short, this is a project which aims to lower the barrier between sharing code client and server side with node, as this ability to share code is one of node's greatest upsides in spite of the difficulties of doing so. I believe there are several other projects that perform similar tasks, but I have no direct experience with any of them.
- beginnerly 16y agoThank you,