shebang-file
TypeScript icon, indicating that this package has built-in type declarations

2.0.0 • Public • Published

Shebang File Travis CI Build Status

Parse the shebang (if any) of a file.

NPM Badge

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 of null.
  • Bluebird promises have been swapped out for native ones.
  • The minimum required Node.js version is now 8.x.

Readme

Keywords

Package Sidebar

Install

npm i shebang-file

Weekly Downloads

2

Version

2.0.0

License

MIT

Unpacked Size

3.25 kB

Total Files

6

Last publish

Collaborators

  • richienb