-
Notifications
You must be signed in to change notification settings - Fork 66
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Number of matches #38
Comments
Hi @mkaragol64, this is not currently possible, but if someone can tame the replace method implementation in this library to report on how many replacements were made then it should be doable. Will leave this open for PR's, as I don't have the time to look into it myself at the moment. |
It would be yes, but I am worried if that might impact performance for large scale replacements. Perhaps it could be enabled and counted only if a flag was passed and set to In addition, currently the library returns an array of files that were changed. If we need to return any other information as well, this would be a breaking change and we'd have to look at returning a result object with various properties, perhaps something like this: const result = {
filesChanged: [
{file: 'foo', numMatches: 10},
{file: 'bar', numMatches: 13},
],
totalMatches: 23,
}; |
Implemented in 4.0.0 |
* Bump dependencies * [feature] #38 Count number of matches * Update make-replacements.js * [feature] #42 Differentiate number of matches and number of replacements * [enhance] #56 Support for CWD parameter * Default config value * [enhance] #63 Add --quiet flag to supress console output in CLI * Update success-handler.js * Update readme and add change log
Hi @adamreisnz
Is it possible to get total number of matches in all files? Or number of total matches file by file? Or both?
The text was updated successfully, but these errors were encountered: