</>PackageGraphPackageGraph

escape-string-regexp

npmv5.0.0

Escape RegExp special characters

Not recommended for new projects

No — escape-string-regexp should not be adopted for new projects. Last published 1971 days ago.

  • AAdoption: grade A, Excellent.

    316.5M downloads per week and 8 known dependents.

  • FMaintenance: grade F, Failing.

    Last published 1971 days ago.

  • AWeight: grade A, Excellent.

    Zero runtime dependencies, about 3.6 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 escape-string-regexp 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.

3.6 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 >=12
Module format
ESM only
TypeScript
No bundled types
Install scripts
None

Quick start

A usage example from the escape-string-regexp README.

import escapeStringRegexp from 'escape-string-regexp';

const escapedString = escapeStringRegexp('How much $ for a 🦄?');
//=> 'How much \\$ for a 🦄\\?'

new RegExp(escapedString);

escape-string-regexp vs the alternatives

Packages solving a similar problem in the npm ecosystem, compared on the signals that drive an adoption decision.

PackageWeekly downloadsDependentsLicenseLast release
escape-string-regexpthis page316.5M8MIT5 years ago
anymatch01ISC1 day ago
is-glob137.4M3MIT1 day ago
is-regex75.1M1MIT1 day ago
is-extglob01MIT1 day ago
jsesc01MIT1 day ago

Dependencies

Declared by escape-string-regexp v5.0.0. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (3)

ava ^3.15.0tsd ^0.14.0xo ^0.38.2

Used by

Popular packages that depend on escape-string-regexp.

Relationship graph

Dependencies (left) and dependents (right) of escape-string-regexp.

Frequently installed together

Release history

No releases in the last two years, typically about 162 days apart.

Recent versions of escape-string-regexp
VersionPublishedSizeLicense
5.0.0latest5 years ago3.6 KBMIT
4.0.06 years ago3.7 KBMIT
3.0.06 years ago3.7 KBMIT
2.0.07 years ago3.2 KBMIT
1.0.510 years agoMIT
1.0.410 years agoMIT
1.0.311 years agoMIT
1.0.212 years agoMIT
1.0.112 years agoMIT
1.0.012 years agoMIT

Overview

escape-string-regexp is an npm package that escape RegExp special characters. It is extremely widely used, with about 316.5M downloads per week and 8 known dependents in the graph. The latest version is 5.0.0, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need escape RegExp special characters and value a battle-tested, widely-adopted 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

  • Large, well-established user base (316.5M weekly downloads).
  • 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

Keywords

Funding

Frequently asked questions

Should I use escape-string-regexp?

No — escape-string-regexp should not be adopted for new projects. Last published 1971 days ago.

How do I install escape-string-regexp?

Run `npm install escape-string-regexp` to add escape-string-regexp to your npm project.

What license is escape-string-regexp released under?

escape-string-regexp is distributed under the MIT license.

How popular is escape-string-regexp?

escape-string-regexp has approximately 316,540,949 downloads per week and 8 known dependent packages.

Is escape-string-regexp still maintained?

The most recent release of escape-string-regexp (v5.0.0) was published 5 years ago.

Does escape-string-regexp run install scripts?

No. escape-string-regexp does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.