shebang-regex
npmv4.0.0Regular expression for matching a shebang line
Not recommended for new projects
No — shebang-regex should not be adopted for new projects. Last published 1853 days ago.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- FMaintenance: grade F, Failing.
Last published 1853 days ago.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 3.2 KB installed.
- BSupply chain: grade B, Good.
This package has a single maintainer (bus factor of 1).
- ALicense: grade A, Excellent.
MIT — permissive, with no copyleft found in the dependency tree.
Grades are computed deterministically from registry metadata collected by PackageGraph — downloads, dependents, publish dates, the resolved dependency tree, maintainer count, and declared licenses. No third-party scores are used.
Install cost
What you actually take on by adding shebang-regex to a project.
Runtime packages this one declares itself.
Distinct packages in the full runtime tree, deduplicated the way a package manager would.
Unpacked size of this package plus its entire runtime tree.
Longest resolved dependency chain below this package.
Compatibility
- Node.js
- node ^12.20.0 || ^14.13.1 || >=16.0.0
- Module format
- ESM only
- TypeScript
- No bundled types
- Install scripts
- None
Quick start
A usage example from the shebang-regex README.
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'shebang-regex vs the alternatives
Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.
| Package | Weekly downloads | Dependents | License | Last release |
|---|---|---|---|---|
| shebang-regexthis page | 0 | 1 | MIT | 5 years ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
| is-extglob | 0 | 1 | MIT | 1 day ago |
| balanced-match | 0 | 1 | MIT | 1 day ago |
| anymatch | 0 | 1 | ISC | 1 day ago |
| escape-string-regexp | 316.5M | 8 | MIT | 1 day ago |
Dependencies
Declared by shebang-regex v4.0.0. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (3)
Used by
Popular packages that depend on shebang-regex.
Relationship graph
Dependencies (left) and dependents (right) of shebang-regex.
Release history
No releases in the last two years, typically about 840 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.0.0latest | 5 years ago | 3.2 KB | MIT |
| 3.0.0 | 7 years ago | 2.8 KB | MIT |
| 2.0.0 | 10 years ago | — | MIT |
| 1.0.0 | 11 years ago | — | MIT |
Overview
shebang-regex is an npm package that regular expression for matching a shebang line. It has 1 known dependents in the graph. The latest version is 4.0.0, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need regular expression for matching a shebang line and value a focused solution.
When not to use it
Consider an alternative if you need to have first-class TypeScript types out of the box, or if a more actively-maintained option better fits your npm stack.
Pros
- Clear open-source license (MIT).
- Lean dependency tree (3 direct dependencies).
Cons
- No bundled TypeScript types (may require a separate @types package).
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use shebang-regex?
No — shebang-regex should not be adopted for new projects. Last published 1853 days ago.
How do I install shebang-regex?
Run `npm install shebang-regex` to add shebang-regex to your npm project.
What license is shebang-regex released under?
shebang-regex is distributed under the MIT license.
How popular is shebang-regex?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on shebang-regex.
Is shebang-regex still maintained?
The most recent release of shebang-regex (v4.0.0) was published 5 years ago.
Does shebang-regex run install scripts?
No. shebang-regex does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.