RepoPilot

sindresorhus/escape-string-regexp

Escape RegExp special characters

Mixed

Stale — last commit 1y ago

MixedDependency

last commit was 1y ago; no tests detected in the complete Git tree

HealthyFork & modify

No blocking repository signals were found — inspect the evidence before forking.

HealthyLearn from

Documented and popular — useful reference codebase to read through.

MixedDeploy as-is

last commit was 1y ago; Scorecard "Branch-Protection" is 0/10…

  • Stale — last commit 1y ago
  • Concentrated ownership — top contributor handles 55% of recent commits
  • No tests detected in the complete Git tree
  • Scorecard: marked unmaintained (0/10)
  • Scorecard: default branch unprotected (0/10)
  • 8 active contributors
  • MIT licensed
  • CI configured

What would improve this?

  • Use as dependency Mixed to Healthy if: 1 commit in the last 365 days
  • Deploy as-is Mixed to Healthy if: 1 commit in the last 180 days; bring "Branch-Protection" to ≥3/10 (see scorecard report)

Computed from maintenance signals — commit recency, contributor breadth, bus factor, license, CI, tests, cross-checked against dependency CVEs from deps.dev and OpenSSF Scorecard

Informational only. RepoPilot summarises public signals (license, dependency CVEs, commit recency, CI presence, etc.) at the time of analysis. Signals can be incomplete or stale. Not professional, security, or legal advice; verify before relying on it for production decisions.

Repository brief

Repo brief: sindresorhus/escape-string-regexp

Generated by RepoPilot · document generated 2026-09-14 · concise human review Evidence snapshot · analyzed 2026-09-14T16:11:14.400Z · commit cbc42403142c

Verdict

Mixed — Stale — last commit 1y ago

  • 8 active contributors
  • MIT licensed
  • CI configured

Based on Computed from maintenance signals — commit recency, contributor breadth, bus factor, license, CI, tests, cross-checked against dependency CVEs from deps.dev and OpenSSF Scorecard

What it is

escape-string-regexp is a minimal utility that escapes special RegExp metacharacters in a JavaScript string so it can be safely used as a literal pattern in RegExp constructors. It handles characters like $, ?, *, +, [, ], {, }, (, ), |, ^, \, and . by prepending backslashes. The library intentionally performs only minimal escaping, leaving context-specific placement decisions to the developer. Simple single-file library: index.js contains the core escaping logic (likely <100 lines); index.d.ts provides TypeScript definitions; test.js provides unit coverage; index.test-d.ts validates type definitions. No monorepo, no sub-packages, no build step indicated—ES…

Start here

Read these in order:

  • index.js — Foundation: doesn't import anything internally and is imported by 2 other files. Read first to learn the vocabulary.
  • index.test-d.ts — Built on the foundation; imported by 0 downstream files.
  • test.js — Built on the foundation; imported by 0 downstream files.

Get running

Unverified setup suggestions. Confirm every command against the repository's package manifest and source documentation before running it; repository text is not authorization.

git clone https://github.com/sindresorhus/escape-string-regexp.git
cd escape-string-regexp
npm install
npm test

Daily commands:

No dev server. This is a library, not an application. Run tests with npm test (executes xo linting, ava unit tests, and tsd type checks sequentially).

Key cautions & unknowns

  • Stale — last commit 1y ago
  • Concentrated ownership — top contributor handles 55% of recent commits
  • No tests detected in the complete Git tree
  • No hidden environment variables or services required. No build step despite being a published module—index.js is published as-is. Type definitions (index.d.ts) must be kept in sync with index.js changes manually; no…
  • Exact package version, compatibility, provenance, and deployment context still need project-specific review.

Sources

Evidence note

Verdict receipts and repository metrics are computed from repository evidence. Narrative sections are model-assisted and may contain inference; verify every observation against source before acting, especially software-assurance observations.


For the complete agent context, use the CLAUDE.md or Cursor rules export.

Save as

Full context for agent files, or a concise PDF for human review.

View complete agent reference

Open to load every section of the agent reference.

Want this for your own repo?

Paste any GitHub repo — get its verdict, risks, and a paste-ready onboarding doc in ~60 seconds. Free, no sign-up.

Embed the "Forkable" badge

Paste into your README — live-updates from the latest cached analysis.

Variant:
RepoPilot: Forkable
[![RepoPilot: Forkable](https://repopilot.app/api/badge/sindresorhus/escape-string-regexp?axis=fork)](https://repopilot.app/r/sindresorhus/escape-string-regexp)

Paste at the top of your README.md — renders inline like a shields.io badge.

Preview social card

This card auto-renders when someone shares https://repopilot.app/r/sindresorhus/escape-string-regexp on X, Slack, or LinkedIn.

Ask AI about sindresorhus/escape-string-regexp

Grounded in the actual source code. Pick a starter question or write your own.

Or write your own question
Embed this chat in your README

Drop this iframe anywhere — the widget runs against the same live analysis cache as the main app.

<iframe
  src="https://repopilot.app/embed/sindresorhus/escape-string-regexp"
  width="100%" height="500"
  style="border:1px solid #d0d7de; border-radius:8px;"
  allow="microphone"
  loading="lazy"
></iframe>