I think it could be useful with async methods too, when you not only want to prevent abuse, but also don't want the regex matching to block other work, which can be important in a server context.
We could do the matching on a worker thread and then send the result back to the main process. This should be possible on both Node.js and the browser.
This is not something I plan to work on, but a good pull request would be welcomed if you need this.
See https://github.com/sindresorhus/crypto-hash/blob/main/index.js for an example of how it could be done.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too