⚠️ Warning: This module is still experimental. It should not be used in production.
Parse javascript files to find unsafe regex (a.k.a. potentially catastrophic exponential-time regular expressions)
srp path/to/my/awsome/project/*.js
nodejs
npm
npm i
-n, --include-node-modules include `node_modules` directory (default: false)
-o, --output-format <format> output format (text|json) (default: text)
-a, --all include safe and unsafe regex in the output, by default only the unsafe regex are included
-v, --version output version information
-h, --help output usage information
const { srp } = require('safe-regex-parser');
const config = {
pathes: ['./path/to/my/awsome/project/*.js'],
};
const result = srp(config);
- Tests
- Handle multiple regex analyzer
- Support multiple parser
- Declare options in a file (including for acorn options)
See the LICENSE file for license rights and limitations (MIT).