shebang-regex
Advanced tools
Weekly downloads
Readme
Regular expression for matching a shebang line
$ npm install shebang-regex
import shebangRegex from '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'
Regular expression for matching a shebang line
The npm package shebang-regex receives a total of 46,946,054 weekly downloads. As such, shebang-regex popularity was classified as popular.
We found that shebang-regex demonstrated a not healthy version release cadence and project activity because the last version was released a year ago.It has 1 open source maintainer collaborating on the project.
Did you know?
Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.