cat-bookmarker/assets/node_modules/shebang-regex
Nat 96939b7aee
Clean up repo and update deps
2024-03-10 11:52:04 -07:00
..
index.d.ts Clean up repo and update deps 2024-03-10 11:52:04 -07:00
index.js Clean up repo and update deps 2024-03-10 11:52:04 -07:00
license Clean up repo and update deps 2024-03-10 11:52:04 -07:00
package.json Clean up repo and update deps 2024-03-10 11:52:04 -07:00
readme.md Clean up repo and update deps 2024-03-10 11:52:04 -07: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