Skip to content
JS
Package

to-regex

Generate a regex from a string or array of strings.

v3.0.2, 24 Feb 2018MITCommonJSTypes: NoneNode.js utilities
$ npm install to-regex

Key numbers

As of 25 Sept 2026
Weekly downloads
9.6m
-11% over 12 months
Gzip bundle size
-
No Bundlephobia data
Dependencies
4
Direct, from package.json
Last release
8 years ago
v3.0.2
GitHub stars
59
10 forks
Open issues / PRs
0 / 2
Contributors
-
Commits, last 52 weeks
0

Downloads

Last week 2026-09-15 to 2026-09-21
05m10m15mSept 2025Mar 2026Sept 2026High 14m (25 Nov 2025)Low 4.7m (23 Dec 2025)
Weekly npm downloads, one point per week, weeks starting 23 Sept 2025 to 15 Sept 2026. The y axis starts at zero.

9,580,120 downloads last week, 38,036,256 in the last month. The 12-month change of -11% compares the average of the last 4 weeks with the first 4 weeks of the series.

Releases, last 12 months
08 in total
Latest version
3.0.2, 24 Feb 20188 years ago
First published
27 Sept 2016
Last push to GitHub
30 Nov 20202,125 days before the snapshot
Repository archived
No
Open issues
0
Open pull requests
2
Commits, last 52 weeks
0
Dependents on npm
665

Major versions

  1. v3 first release 3.0.0, 17 Oct 2016
  2. v2 first release 2.0.0, 6 Oct 2016
  3. v1 first release 1.0.0, 4 Oct 2016
  4. v0 first release 0.1.0, 27 Sept 2016

Recent releases

VersionPublished
3.0.224 Feb 2018
3.0.117 Oct 2016
3.0.017 Oct 2016
2.1.06 Oct 2016
2.0.06 Oct 2016
1.0.04 Oct 2016
0.1.127 Sept 2016
0.1.027 Sept 2016
Module format
CommonJSFrom package.json type, main and exports fields
TypeScript types
None
Node.js engine range
>=0.10.0
Runtimes
-
Unpacked size (npm)
12 kB
Dependencies (4)
regex-notsafe-regexextend-shallowdefine-property
npm install to-regex
  • jsDelivrhttps://cdn.jsdelivr.net/npm/to-regex@3.0.2/
  • unpkghttps://unpkg.com/to-regex@3.0.2/
  • esm.shhttps://esm.sh/to-regex@3.0.2
Sources: npm registry, npm downloads API, GitHub API. Data fetched 25 Sept 2026.

Indexability: Indexed.