Skip to content

Should index.js be executable? #80

@erikkemperman

Description

@erikkemperman

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions