• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex)
2
3> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix))
4
5
6## Install
7
8```
9$ npm install --save shebang-regex
10```
11
12
13## Usage
14
15```js
16var shebangRegex = require('shebang-regex');
17var str = '#!/usr/bin/env node\nconsole.log("unicorns");';
18
19shebangRegex.test(str);
20//=> true
21
22shebangRegex.exec(str)[0];
23//=> '#!/usr/bin/env node'
24```
25
26
27## License
28
29MIT © [Sindre Sorhus](http://sindresorhus.com)
30