Package
to-regex
Generate a regex from a string or array of strings.
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
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
- v3 first release 3.0.0, 17 Oct 2016
- v2 first release 2.0.0, 6 Oct 2016
- v1 first release 1.0.0, 4 Oct 2016
- v0 first release 0.1.0, 27 Sept 2016
Recent releases
| Version | Published |
|---|---|
| 3.0.2 | 24 Feb 2018 |
| 3.0.1 | 17 Oct 2016 |
| 3.0.0 | 17 Oct 2016 |
| 2.1.0 | 6 Oct 2016 |
| 2.0.0 | 6 Oct 2016 |
| 1.0.0 | 4 Oct 2016 |
| 0.1.1 | 27 Sept 2016 |
| 0.1.0 | 27 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- jsDelivr
https://cdn.jsdelivr.net/npm/to-regex@3.0.2/ - unpkg
https://unpkg.com/to-regex@3.0.2/ - esm.sh
https://esm.sh/to-regex@3.0.2
Indexability: Indexed.