Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@regexp-extra/shebang

0.1.2 • Public • Published

RegExp for matching shebang line.

const SHEBANG = require('@regexp-extra/shebang');
// -> regular expression
 
 
var str = '#!/usr/bin/env node\nconsole.log("unicorns");';
SHEBANG.test(str);
// true
 
new RegExp(SHEBANG).exec(str);
// [ '#!/usr/bin/env node',
//   '/usr/bin/env node',
//   index: 0,
//   input: '#!/usr/bin/env node\nconsole.log("unicorns");',
//   groups: undefined ]

NPM

credits: taken directly from sindresorhus/shebang-regex.

Install

npm i @regexp-extra/shebang

DownloadsWeekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

1.15 kB

Total Files

3

Last publish

Collaborators

  • avatar