1.0.1 • Published 7 years ago

has-shebang v1.0.1

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

has-shebang

check if string or file contains shebang

Made with ❤ at @outlandish

Install

npm install --save has-shebang
yarn add has-shebang

Import

// ES2015
import hasShebang from 'has-shebang'
// CommonJS
var hasShebang = require('has-shebang')

Usage

hasShebang(input) : Boolean

Check if a file or string has a shebang.

  • input {String} (required) string to check or path to file

Returns true if has shebang, false otherwise.

Example

import hasShebang from 'has-shebang'

hasShebang('#!/usr/bin/env/node') //=> true
hasShebang('#spongebob') //=> false

Contributing

All pull requests and issues welcome!

If you're not sure how, check out the great video tutorials on egghead.io!

License

MIT © Sam Gluck