shebang-regex
Advanced tools
Comparing version 2.0.0 to 3.0.0
{ | ||
"name": "shebang-regex", | ||
"version": "2.0.0", | ||
"description": "Regular expression for matching a shebang line", | ||
"license": "MIT", | ||
"repository": "sindresorhus/shebang-regex", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=0.10.0" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava" | ||
}, | ||
"files": [ | ||
"index.js" | ||
], | ||
"keywords": [ | ||
"re", | ||
"regex", | ||
"regexp", | ||
"shebang", | ||
"match", | ||
"test", | ||
"line" | ||
], | ||
"devDependencies": { | ||
"ava": "*", | ||
"xo": "*" | ||
} | ||
"name": "shebang-regex", | ||
"version": "3.0.0", | ||
"description": "Regular expression for matching a shebang line", | ||
"license": "MIT", | ||
"repository": "sindresorhus/shebang-regex", | ||
"author": { | ||
"name": "Sindre Sorhus", | ||
"email": "sindresorhus@gmail.com", | ||
"url": "sindresorhus.com" | ||
}, | ||
"engines": { | ||
"node": ">=8" | ||
}, | ||
"scripts": { | ||
"test": "xo && ava && tsd" | ||
}, | ||
"files": [ | ||
"index.js", | ||
"index.d.ts" | ||
], | ||
"keywords": [ | ||
"regex", | ||
"regexp", | ||
"shebang", | ||
"match", | ||
"test", | ||
"line" | ||
], | ||
"devDependencies": { | ||
"ava": "^1.4.1", | ||
"tsd": "^0.7.2", | ||
"xo": "^0.24.0" | ||
} | ||
} |
@@ -9,3 +9,3 @@ # shebang-regex [![Build Status](https://travis-ci.org/sindresorhus/shebang-regex.svg?branch=master)](https://travis-ci.org/sindresorhus/shebang-regex) | ||
``` | ||
$ npm install --save shebang-regex | ||
$ npm install shebang-regex | ||
``` | ||
@@ -18,9 +18,13 @@ | ||
const shebangRegex = require('shebang-regex'); | ||
const str = '#!/usr/bin/env node\nconsole.log("unicorns");'; | ||
shebangRegex.test(str); | ||
const string = '#!/usr/bin/env node\nconsole.log("unicorns");'; | ||
shebangRegex.test(string); | ||
//=> true | ||
shebangRegex.exec(str)[0]; | ||
shebangRegex.exec(string)[0]; | ||
//=> '#!/usr/bin/env node' | ||
shebangRegex.exec(string)[1]; | ||
//=> '/usr/bin/env node' | ||
``` | ||
@@ -31,2 +35,2 @@ | ||
MIT © [Sindre Sorhus](http://sindresorhus.com) | ||
MIT © [Sindre Sorhus](https://sindresorhus.com) |
Sorry, the diff of this file is not supported yet
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
2828
5
18
34
0
3