python-archieve-projects/WechatBot/node_modules/shebang-regex
Lee2vv 0b82373111 init 2024-05-05 13:46:50 +08:00
..
index.d.ts Backup 2023-08-18 21:52:54 +08:00
index.js init 2024-05-05 13:46:50 +08:00
license Backup 2023-08-18 21:52:54 +08:00
package.json Backup 2023-08-18 21:52:54 +08:00
readme.md Backup 2023-08-18 21:52:54 +08: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