blob: 61d034b31eb8fc9baf1eda2bfbf804cb0a47ec1f [file] [log] [blame]
Tim van der Lippe16aca392020-11-13 11:37:13 +00001/**
2Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line.
3
4@example
5```
6import shebangRegex = require('shebang-regex');
7
8const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
9
10shebangRegex.test(string);
11//=> true
12
13shebangRegex.exec(string)[0];
14//=> '#!/usr/bin/env node'
15
16shebangRegex.exec(string)[1];
17//=> '/usr/bin/env node'
18```
19*/
20declare const shebangRegex: RegExp;
21
22export = shebangRegex;