Purrfect Matcher is a powerful and efficient multi-threaded text matching tool for finding keyword occurrences in large files.
- Reads large files in chunks to handle memory efficiently.
- Uses multiple threads to process chunks in parallel.
- Supports case-insensitive matching.
- Outputs results in JSON format or a human-readable format.
- Optionally prints execution time.
To install the dependencies, run:
npm installTo run the Purrfect Matcher, use the following command:
npm run start -- <input-file> [options]This command should be run in the root directory of the project after building the project with npm run build.
Alternatively you can use ts-node to run the project without building:
npx ts-node src/main.ts <input-file> [options]input(required): Path to the input file.--output(optional): Path to the output file. If not specified, the results will be printed to the console.--threads(optional): Number of threads to use (default: number of CPUs).--ignore-case(optional): Case insensitive matching.--time(optional): Print execution time.--json(optional): Output results in JSON format.
npm run start -- input.txt --output results.txt --threads 4 --ignore-case --time --jsonYou can download test file from https://norvig.com/big.txt by running the following command.
curl https://norvig.com/big.txt > big.txtThis project is licensed under the MIT License. See the LICENSE file for more details.