</>PackageGraphPackageGraph

is-regex

npmv1.2.1TypeScript

Is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag

Adopt with care

is-regex is usable, with caveats. Last published 637 days ago. 2 releases in the last 2 years.

  • AAdoption: grade A, Excellent.

    75.1M downloads per week and 1 known dependents.

  • CMaintenance: grade C, Fair — worth a look.

    Last published 637 days ago. 2 releases in the last 2 years.

  • BWeight: grade B, Good.

    Pulls in 13 transitive packages, about 231 KB installed (at least — some of the tree is still being crawled).

  • 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 is-regex to a project.

4
Direct dependencies

Runtime packages this one declares itself.

13
Total installed

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

231 KB
Install size

Unpacked size of this package plus its entire runtime tree.

3
Tree depth

Longest resolved dependency chain below this package.

Part of this dependency tree has not been crawled yet, so these figures are a lower bound rather than a final total.

Licenses in the dependency tree

MIT

Every license you inherit by installing is-regex, not just its own. Check this before a legal review, not after.

Compatibility

Node.js
node >= 0.4
Module format
CommonJS only
TypeScript
Types included
Install scripts
None

Quick start

A usage example from the is-regex README.

var isRegex = require('is-regex');
var assert = require('assert');

assert.notOk(isRegex(undefined));
assert.notOk(isRegex(null));
assert.notOk(isRegex(false));
assert.notOk(isRegex(true));
assert.notOk(isRegex(42));
assert.notOk(isRegex('foo'));
assert.notOk(isRegex(function () {}));
assert.notOk(isRegex([]));
assert.notOk(isRegex({}));

assert.ok(isRegex(/a/g));
Example truncated — see the full README.

is-regex vs the alternatives

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

PackageWeekly downloadsDependentsLicenseLast release
is-regexthis page75.1M1MIT1 year ago
escape-string-regexp316.5M8MIT1 day ago
is-glob137.4M3MIT1 day ago
is-extglob01MIT1 day ago
anymatch01ISC1 day ago
regexp.prototype.flags01MIT1 day ago

Dependencies

Declared by is-regex v1.2.1. Runtime dependencies are installed with the package; dev dependencies are not.

Dev (18)

@arethetypeswrong/cli ^0.17.1@ljharb/eslint-config ^21.1.1@ljharb/tsconfig ^0.2.2@types/core-js ^2.5.8@types/for-each ^0.3.3@types/tape ^5.6.5auto-changelog ^2.5.0core-js ^3.39.0eclint ^2.8.1encoding ^0.1.13eslint =8.8.0for-each ^0.3.3in-publish ^2.0.1npmignore ^0.3.1nyc ^10.3.2safe-publish-latest ^2.0.0tape ^5.9.0typescript ^5.8.0-dev.20241129

Used by

Popular packages that depend on is-regex.

Relationship graph

Dependencies (left) and dependents (right) of is-regex.

Frequently installed together

Release history

1 release in the last two years, typically about 124 days apart.

Recent versions of is-regex
VersionPublishedSizeLicense
1.2.1latest1 year ago35 KBMIT
1.2.01 year ago34 KBMIT
1.1.45 years ago29 KBMIT
1.1.35 years ago29 KBMIT
1.1.25 years ago28 KBMIT
1.1.16 years ago26 KBMIT
1.1.06 years ago26 KBMIT
1.0.56 years ago23 KBMIT
1.0.49 years agoMIT
1.0.311 years agoMIT
1.0.211 years agoMIT
1.0.111 years agoMIT
1.0.012 years agoMIT
0.0.012 years agoMIT

Overview

is-regex is an npm package that is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag. It is extremely widely used, with about 75.1M downloads per week and 1 known dependents in the graph. The latest version is 1.2.1, released under the MIT license.

Who should use it

Teams working in the npm ecosystem who need is this value a JS regex? Works cross-realm/iframe, and despite ES6 @@toStringTag and value a battle-tested, widely-adopted solution.

When not to use it

Consider an alternative if you need to minimize your dependency tree, or if a more actively-maintained option better fits your npm stack.

Pros

  • Large, well-established user base (75.1M weekly downloads).
  • Ships TypeScript type definitions.
  • Clear open-source license (MIT).

Cons

  • Large dependency tree (22 direct dependencies) increases install size and audit surface.

Auto-generated from collected registry metadata. No external claims are inferred.

Maintainers

Keywords

Funding

Frequently asked questions

Should I use is-regex?

is-regex is usable, with caveats. Last published 637 days ago. 2 releases in the last 2 years.

How do I install is-regex?

Run `npm install is-regex` to add is-regex to your npm project.

How many dependencies does is-regex have?

is-regex declares 22 direct dependencies and pulls in 13 packages in total once its runtime tree is resolved totalling about 231 KB on disk.

What license is is-regex released under?

is-regex is distributed under the MIT license.

How popular is is-regex?

is-regex has approximately 75,107,167 downloads per week and 1 known dependent packages.

Is is-regex still maintained?

The most recent release of is-regex (v1.2.1) was published 1 year ago.

Does is-regex run install scripts?

No. is-regex does not define preinstall, install, or postinstall scripts, so installing it does not execute publisher-supplied code.