Portfolio/node_modules/.pnpm/shebang-regex@3.0.0/node_modules/shebang-regex
2024-02-14 16:38:58 -05:00
..
index.d.ts added TailwindCSS support 2024-02-14 16:38:58 -05:00
index.js added TailwindCSS support 2024-02-14 16:38:58 -05:00
license added TailwindCSS support 2024-02-14 16:38:58 -05:00
package.json added TailwindCSS support 2024-02-14 16:38:58 -05:00
readme.md added TailwindCSS support 2024-02-14 16:38:58 -05:00

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