Little wrapper script to allow running your .mjs file via its shebang
The "esm" module has the nice invocation method of running an ES module file like this:
$ nodejs -r esm test/nospace.mjsutil.promisify? function
However, if you try to use that in a shebang line, you'll get an error like
$ ./test/nospace.mjs/usr/bin/env: node -r esm: No such file or directory
… because the you can only pass one arg after the program name.
This package contains a small bash script that inserts the
options, so you can write your shebang like this:
and this run your module like this:
$ ./test/shebang.mjsutil.promisify? function
- This module doesn't (yet) care about whether the
esmmodule is installed, or where. Your package will probably have to declare it as a dependency. The version used, and whether nodejs will find it, might even depend on the current working directory from which the shebang file is invoked.