safe-regex2
npmv5.1.1TypeScriptdetect possibly catastrophic, exponential-time regular expressions
Safe to adopt
Yes — safe-regex2 scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 144 days ago. 4 releases in the last 2 years.
- ?Adoption: grade ?, Not reported by this registry.
No download data reported for this package yet.
- BMaintenance: grade B, Good.
Last published 144 days ago. 4 releases in the last 2 years.
- AWeight: grade A, Excellent.
Pulls in 1 transitive package, about 79 KB installed.
- ASupply chain: grade A, Excellent.
No install scripts, 10 maintainers, and a contained dependency surface.
- 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 safe-regex2 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.
Licenses in the dependency tree
Every license you inherit by installing safe-regex2, not just its own. Check this before a legal review, not after.
Compatibility
- Node.js
- No constraint declared
- Module format
- CommonJS only
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the safe-regex2 README.
const safe = require('safe-regex2');
const regex = process.argv.slice(2).join(' ');
console.log(safe(regex));safe-regex2 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 |
|---|---|---|---|---|
| safe-regex2this page | 0 | 2 | MIT | 4 months ago |
| escape-string-regexp | 316.5M | 8 | MIT | 1 day ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
| is-regex | 75.1M | 1 | MIT | 1 day ago |
| json-stringify-safe | 36.4M | 1 | ISC | 1 day ago |
| exponential-backoff | 25.7M | 1 | Apache-2.0 | 1 day ago |
Dependencies
Declared by safe-regex2 v5.1.1. Runtime dependencies are installed with the package; dev dependencies are not.
Runtime (1)
Dev (4)
Used by
Popular packages that depend on safe-regex2.
Relationship graph
Dependencies (left) and dependents (right) of safe-regex2.
Frequently installed together
Really Fast Deep Clone
Fast deep equal
TypeScript definitions for node
A fast alternative to legacy querystring module
An AST-based pattern checker for JavaScript.
Plugin for loglevel message prefixing
Minimal lightweight logging for JavaScript, adding reliable log level methods to any available console.log methods
Release history
4 releases in the last two years, typically about 194 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 5.1.1latest | 4 months ago | 11 KB | MIT |
| 5.1.0 | 6 months ago | 11 KB | MIT |
| 5.0.0 | 1 year ago | 9.0 KB | MIT |
| 4.0.1 | 1 year ago | 9.0 KB | MIT |
| 4.0.0 | 2 years ago | 7.8 KB | MIT |
| 3.1.0 | 3 years ago | 7.4 KB | MIT |
| 3.0.0 | 4 years ago | 6.3 KB | MIT |
| 2.0.0 | 7 years ago | 5.3 KB | MIT |
Overview
safe-regex2 is an npm package that detect possibly catastrophic, exponential-time regular expressions. It has 2 known dependents in the graph. The latest version is 5.1.1, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need detect possibly catastrophic, exponential-time regular expressions and value a focused solution.
When not to use it
Consider an alternative if you need to or if a more actively-maintained option better fits your npm stack.
Pros
- Ships TypeScript type definitions.
- Clear open-source license (MIT).
Cons
- No significant drawbacks detected from available metadata.
Auto-generated from collected registry metadata. No external claims are inferred.
Maintainers
Funding
Frequently asked questions
Should I use safe-regex2?
Yes — safe-regex2 scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 144 days ago. 4 releases in the last 2 years.
How do I install safe-regex2?
Run `npm install safe-regex2` to add safe-regex2 to your npm project.
How many dependencies does safe-regex2 have?
safe-regex2 declares 5 direct dependencies and pulls in 1 packages in total once its runtime tree is resolved totalling about 79 KB on disk.
What license is safe-regex2 released under?
safe-regex2 is distributed under the MIT license.
How popular is safe-regex2?
npm does not publish download counts. Within PackageGraph's crawl, 2 known packages depend on safe-regex2.
Is safe-regex2 still maintained?
The most recent release of safe-regex2 (v5.1.1) was published 4 months ago.
Does safe-regex2 run install scripts?
No. safe-regex2 does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.