npm

Need private packages and team management tools?Check out npm Orgs. »

shebang-regex

3.0.0 • Public • Published

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

install

npm i shebang-regex

Downloadsweekly downloads

12,168,273

version

3.0.0

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability