aboutsummaryrefslogtreecommitdiff
path: root/node_modules/shebang-regex/readme.md
blob: ef75e51b5bf0fe4fdf5b7ade5dd8edf229214a5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
# shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex)

> Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix))


## Install

```
$ npm install --save shebang-regex
```


## Usage

```js
var shebangRegex = require('shebang-regex');
var str = '#!/usr/bin/env node\nconsole.log("unicorns");';

shebangRegex.test(str);
//=> true

shebangRegex.exec(str)[0];
//=> '#!/usr/bin/env node'
```


## License

MIT © [Sindre Sorhus](http://sindresorhus.com)