codeql-action/node_modules/shebang-regex
github-actions[bot] 0da815296a Update checked-in dependencies 2022-02-24 17:03:29 +00:00
..
index.d.ts Update checked-in dependencies 2021-08-09 19:49:49 +00:00
index.js Update checked-in dependencies 2021-08-09 19:49:49 +00:00
license Update checked-in dependencies 2021-08-09 19:49:49 +00:00
package.json Update checked-in dependencies 2022-02-24 17:03:29 +00:00
readme.md Update checked-in dependencies 2021-08-09 19:49:49 +00:00

readme.md

shebang-regex Build Status

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