balanced-match
npmv4.0.4TypeScriptMatch balanced character pairs, like "{" and "}"
Safe to adopt
Yes — balanced-match scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 199 days ago. 3 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 199 days ago. 3 releases in the last 2 years.
- AWeight: grade A, Excellent.
Zero runtime dependencies, about 17 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 balanced-match 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 18 || 20 || >=22
- Module format
- ESM + CommonJS
- TypeScript
- Types included
- Install scripts
- None
Quick start
A usage example from the balanced-match README.
import { balanced } from 'balanced-match'
console.log(balanced('{', '}', 'pre{in{nested}}post'))
console.log(balanced('{', '}', 'pre{first}between{second}post'))
console.log(
balanced(/\s+\{\s+/, /\s+\}\s+/, 'pre { in{nest} } post'),
)balanced-match 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 |
|---|---|---|---|---|
| balanced-matchthis page | 0 | 1 | MIT | 6 months ago |
| shebang-regex | 0 | 1 | MIT | 1 day ago |
| is-glob | 137.4M | 3 | MIT | 1 day ago |
| is-extglob | 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 balanced-match v4.0.4. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (7)
Used by
Popular packages that depend on balanced-match.
Relationship graph
Dependencies (left) and dependents (right) of balanced-match.
Frequently installed together
Release history
3 releases in the last two years, typically about 87 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 4.0.4latest | 6 months ago | 17 KB | MIT |
| 4.0.3 | 6 months ago | 17 KB | MIT |
| 4.0.2 | 7 months ago | 17 KB | MIT |
| 3.0.1 | 2 years ago | 12 KB | MIT |
| 3.0.0 | 2 years ago | 7.0 KB | MIT |
| 2.0.0 | 5 years ago | 6.9 KB | MIT |
| 1.0.2 | 5 years ago | 6.8 KB | MIT |
| 1.0.1 | 5 years ago | 6.9 KB | MIT |
| 1.0.0 | 9 years ago | — | MIT |
| 0.4.2 | 10 years ago | — | MIT |
| 0.4.1 | 10 years ago | — | MIT |
| 0.4.0 | 10 years ago | — | MIT |
| 0.3.0 | 10 years ago | — | MIT |
| 0.2.1 | 11 years ago | — | MIT |
| 0.2.0 | 11 years ago | — | MIT |
Overview
balanced-match is an npm package that match balanced character pairs, like "{" and "}". It has 1 known dependents in the graph. The latest version is 4.0.4, released under the MIT license.
Who should use it
Teams working in the npm ecosystem who need match balanced character pairs, like "{" and "}" 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
Frequently asked questions
Should I use balanced-match?
Yes — balanced-match scores well across adoption, maintenance, weight, supply chain, and licensing. No download data reported for this package yet. Last published 199 days ago. 3 releases in the last 2 years.
How do I install balanced-match?
Run `npm install balanced-match` to add balanced-match to your npm project.
What license is balanced-match released under?
balanced-match is distributed under the MIT license.
How popular is balanced-match?
npm does not publish download counts. Within PackageGraph's crawl, 1 known packages depend on balanced-match.
Is balanced-match still maintained?
The most recent release of balanced-match (v4.0.4) was published 6 months ago.
Does balanced-match run install scripts?
No. balanced-match does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.