main
Last change
on this file was d565449, checked in by stefan toskovski <stefantoska84@…>, 4 weeks ago |
Update repo after prototype presentation
|
-
Property mode
set to
100644
|
File size:
446 bytes
|
Rev | Line | |
---|
[d565449] | 1 | /**
|
---|
| 2 | Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix)) line.
|
---|
| 3 |
|
---|
| 4 | @example
|
---|
| 5 | ```
|
---|
| 6 | import shebangRegex = require('shebang-regex');
|
---|
| 7 |
|
---|
| 8 | const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
|
---|
| 9 |
|
---|
| 10 | shebangRegex.test(string);
|
---|
| 11 | //=> true
|
---|
| 12 |
|
---|
| 13 | shebangRegex.exec(string)[0];
|
---|
| 14 | //=> '#!/usr/bin/env node'
|
---|
| 15 |
|
---|
| 16 | shebangRegex.exec(string)[1];
|
---|
| 17 | //=> '/usr/bin/env node'
|
---|
| 18 | ```
|
---|
| 19 | */
|
---|
| 20 | declare const shebangRegex: RegExp;
|
---|
| 21 |
|
---|
| 22 | export = shebangRegex;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.