2.0.0 • Published 4 years ago
shebang-file v2.0.0
Shebang File
Parse the shebang (if any) of a file.
Install
npm install shebang-file
Usage
const shebangFile = require("shebang-file");
(async () => {
await shebangFile("myScript.sh");
//=> 'bash'
})();
API
shebangFile(filename)
filename
Type: string
The filename to parse the shebang from.
Migrating from v1
- If a shebang isn't found,
undefined
is now returned instead ofnull
. - Bluebird promises have been swapped out for native ones.
- The minimum required Node.js version is now 8.x.