🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more

shebang-regex

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install
s

shebang-regex

Regular expression for matching a shebang line

4.0.0
latest
100

Supply Chain Security

100

Vulnerability

69

Quality

76

Maintenance

100

License

Version published
Weekly downloads
85M
4.63%
Maintainers
1
Weekly downloads
 
Created
Issues
0

What is shebang-regex?

The shebang-regex npm package is a simple utility that provides a regular expression for matching shebang lines in files. A shebang line is the first line in a script file that is used to indicate the script interpreter to be used to execute the file. It is commonly found at the top of script files in Unix-based systems and starts with '#!'. This package helps in identifying and extracting the shebang line from files.

What are shebang-regex's main functionalities?

Shebang line matching

The shebang-regex package exports a regular expression that matches the shebang line. Here's an example of how to use it in code to test if a string contains a shebang line: `const shebangRegex = require('shebang-regex'); console.log(shebangRegex.test('#!/usr/bin/env node')); // true`

/^#!.+/

Other packages similar to shebang-regex

FAQs

Package last updated on 13 Aug 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts