has-shebang

1.0.1 • Public • Published

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

Dependencies (0)

    Dev Dependencies (4)

    Package Sidebar

    Install

    npm i has-shebang

    Weekly Downloads

    0

    Version

    1.0.1

    License

    MIT

    Last publish

    Collaborators

    • sdgluck