</>PackageGraphPackageGraph

balanced-match

npmv4.0.4TypeScript

Match 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.

0
Direct dependencies

Runtime packages this one declares itself.

0
Total installed

Distinct packages in the full runtime tree, deduplicated the way a package manager would.

17 KB
Install size

Unpacked size of this package plus its entire runtime tree.

Tree depth

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.

PackageWeekly downloadsDependentsLicenseLast release
balanced-matchthis page01MIT6 months ago
shebang-regex01MIT1 day ago
is-glob137.4M3MIT1 day ago
is-extglob01MIT1 day ago
anymatch01ISC1 day ago
escape-string-regexp316.5M8MIT1 day ago

Dependencies

Declared by balanced-match v4.0.4. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (7)

@types/brace-expansion ^1.1.2@types/node ^25.2.1mkdirp ^3.0.1prettier ^3.3.2tap ^21.6.2tshy ^3.0.2typedoc ^0.28.5

Used by

Popular packages that depend on balanced-match.

Relationship graph

Dependencies (left) and dependents (right) of balanced-match.

brace-expansionbalanced-match
balanced-match dependencies dependents

Frequently installed together

Release history

3 releases in the last two years, typically about 87 days apart.

Recent versions of balanced-match
VersionPublishedSizeLicense
4.0.4latest6 months ago17 KBMIT
4.0.36 months ago17 KBMIT
4.0.27 months ago17 KBMIT
3.0.12 years ago12 KBMIT
3.0.02 years ago7.0 KBMIT
2.0.05 years ago6.9 KBMIT
1.0.25 years ago6.8 KBMIT
1.0.15 years ago6.9 KBMIT
1.0.09 years agoMIT
0.4.210 years agoMIT
0.4.110 years agoMIT
0.4.010 years agoMIT
0.3.010 years agoMIT
0.2.111 years agoMIT
0.2.011 years agoMIT

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

Keywords

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.