is-regex
npmv1.2.1TypeScriptIs 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.
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.
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
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));is-regex 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 |
|---|---|---|---|---|
| is-regexthis page | 75.1M | 1 | MIT | 1 year ago |
| escape-string-regexp | 316.5M | 8 | 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 |
| regexp.prototype.flags | 0 | 1 | MIT | 1 day ago |
Dependencies
Declared by is-regex v1.2.1. Runtime dependencies are installed with the package; dev dependencies are not.
Dev (18)
Used by
Popular packages that depend on is-regex.
Relationship graph
Dependencies (left) and dependents (right) of is-regex.
Frequently installed together
Array#isArray for older browsers
An AST-based pattern checker for JavaScript.
Robustly `.call.bind()` a function
Is this an arguments object? It's a harder question than you think.
ES2015-compliant shim for Object.is - differentiates between -0 and +0
Get the byte length of an ArrayBuffer, even in engines without a `.byteLength` method.
Get an iterator for any JS language value. Works robustly across all environments, all versions.
Store information about any JS value in a side channel. Uses WeakMap if available.
Is this value a JS SharedArrayBuffer?
The semantic version parser used by npm.
Get and robustly cache all JS language-level intrinsics at first require time
ES6 spec-compliant RegExp.prototype.flags shim.
Release history
1 release in the last two years, typically about 124 days apart.
| Version | Published | Size | License |
|---|---|---|---|
| 1.2.1latest | 1 year ago | 35 KB | MIT |
| 1.2.0 | 1 year ago | 34 KB | MIT |
| 1.1.4 | 5 years ago | 29 KB | MIT |
| 1.1.3 | 5 years ago | 29 KB | MIT |
| 1.1.2 | 5 years ago | 28 KB | MIT |
| 1.1.1 | 6 years ago | 26 KB | MIT |
| 1.1.0 | 6 years ago | 26 KB | MIT |
| 1.0.5 | 6 years ago | 23 KB | MIT |
| 1.0.4 | 9 years ago | — | MIT |
| 1.0.3 | 11 years ago | — | MIT |
| 1.0.2 | 11 years ago | — | MIT |
| 1.0.1 | 11 years ago | — | MIT |
| 1.0.0 | 12 years ago | — | MIT |
| 0.0.0 | 12 years ago | — | MIT |
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
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.