@cjser/shebang-regex
v4.0.0-cjser.2
Published
Regular expression for matching a shebang line
Downloads
14
Maintainers
Readme
shebang-regex
Regular expression for matching a shebang line
Install
$ npm install shebang-regexUsage
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'cjser
This package is a CommonJS-compatible build generated by cjser for projects that still need require() support. The source version matches the original npm package version, with a cjser prerelease suffix for this generated build.
Original repository: https://github.com/sindresorhus/shebang-regex
