shebang-regex
Regular expression for matching a shebang line
Install
$ npm install shebang-regex
Usage
const shebangRegex = require('shebang-regex');
const string = '#!/usr/bin/env node\nconsole.log("unicorns");';
shebangRegex.test(string);
//=> true
shebangRegex.exec(string)[0];
//=> '#!/usr/bin/env node'
shebangRegex.exec(string)[1];
//=> '/usr/bin/env node'
License
MIT © Sindre Sorhus
Xet Storage Details
- Size:
- 649 Bytes
- Xet hash:
- d1b82a098af9d2a4ad90079ec3293ba575096d801490a8d77f8eef0664ae4c14
·
Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.