2.0.0 • Published 4 years ago

shebang-file v2.0.0

Weekly downloads
5
License
MIT
Repository
github
Last release
4 years ago

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.