Loading a big .txt file into memory and comparing each request to it feels like a good first start. Hopefully the open source community takes it further.
Here is a random Node binding for libModSecurity I found: https://github.com/manishmalik/Modsecurity-nodejs