You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

29 lines
580 B

4 years ago
  1. # shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex)
  2. > Regular expression for matching a [shebang](https://en.wikipedia.org/wiki/Shebang_(Unix))
  3. ## Install
  4. ```
  5. $ npm install --save shebang-regex
  6. ```
  7. ## Usage
  8. ```js
  9. var shebangRegex = require('shebang-regex');
  10. var str = '#!/usr/bin/env node\nconsole.log("unicorns");';
  11. shebangRegex.test(str);
  12. //=> true
  13. shebangRegex.exec(str)[0];
  14. //=> '#!/usr/bin/env node'
  15. ```
  16. ## License
  17. MIT © [Sindre Sorhus](http://sindresorhus.com)