Building a tool with separate core and cli, I was looking at gulp and gulp-cli (4.0 branches) for an example. I noticed that gulp-cli/index.js has a shebang line and executable mode, but I can't figure out why...
The script exports a function, running it with ./index.js doesn't really do anything, it seems to me. Is there something clever going on here, or is this maybe a leftover of an earlier setup? It looks like it would have made sense before these:
gulpjs/gulp@95ce47a
6b2c2ef
I was also wondering why gulp has its own executable bin/gulp.js, which just requires gulp-cli and runs the exported function -- but now I suspect that this is in case users do npm install -g gulp (instead of installing only gulp-cli globally as recommended in the getting started guide). Have I got that right?
Building a tool with separate core and cli, I was looking at gulp and gulp-cli (4.0 branches) for an example. I noticed that
gulp-cli/index.jshas a shebang line and executable mode, but I can't figure out why...The script exports a function, running it with
./index.jsdoesn't really do anything, it seems to me. Is there something clever going on here, or is this maybe a leftover of an earlier setup? It looks like it would have made sense before these:gulpjs/gulp@95ce47a
6b2c2ef
I was also wondering why gulp has its own executable
bin/gulp.js, which just requires gulp-cli and runs the exported function -- but now I suspect that this is in case users donpm install -g gulp(instead of installing only gulp-cli globally as recommended in the getting started guide). Have I got that right?