Socket
Socket
Sign inDemoInstall

shebang-regex

Package Overview
Dependencies
0
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 2.0.0 to 3.0.0

index.d.ts

65

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc