safe-regex-test is an npm package that provides a safer alternative to JavaScript's built-in RegExp.prototype.test method. It mitigates the risk of regular expression denial-of-service (ReDoS) attacks by limiting the execution time of the regex test. If the test takes too long, it aborts and returns false, preventing potential server crashes caused by maliciously crafted regular expressions. It enhances application security and reliability when dealing with user-provided regular expressions.
The npm package safe-regex-test saw infrequent releases. One version (1.0.0) was published in September 2022. No releases occurred for over a year until January 2024, which saw versions 1.0.1 and 1.0.2. Version 1.0.3 appeared in February 2024, and 1.1.0 in December 2024. No releases have occurred in 2025 through September 5th.
Safe-regex-test's npm downloads show a strong upward trend from March 2024 to August 2025, peaking at over 183 million. September 2025 data, incomplete, shows a significant drop, likely due to partial month data. The package consistently exceeded 100 million downloads monthly since April 2024.