1 | # 4.0.0
|
2 |
|
3 | ## Breaking changes
|
4 | The return value is now a results array instead of an array with changed files. The new results array includes each file that was processed, with a flag to indicate whether or not the file was changed, and optionally information about the number of matches and replacements that were made. See the readme for more details.
|
5 |
|
6 | To update existing code and obtain an array of changed files again, simply convert the results array as follows:
|
7 |
|
8 | ```js
|
9 | const results = await replace(options);
|
10 | const changedFiles = results
|
11 | .filter(result => result.hasChanged)
|
12 | .map(result => result.file);
|
13 | ```
|
14 |
|
15 | ## New features
|
16 | - Added `countMatches` flag to count the number of matches and replacements per file [#38](https://github.com/adamreisnz/replace-in-file/issues/38), [#42](https://github.com/adamreisnz/replace-in-file/issues/42), [#61](https://github.com/adamreisnz/replace-in-file/issues/61)
|
17 | - Added `--quiet` flag for CLI to suppress success output [#63](https://github.com/adamreisnz/replace-in-file/issues/63)
|
18 | - Added `cwd` configuration parameter for network drive replacements [#56](https://github.com/adamreisnz/replace-in-file/issues/56)
|
19 |
|
20 | # 3.0.0
|
21 |
|
22 | ## Breaking changes
|
23 | From version 3.0.0 onwards, replace in file requires Node 6 or higher. If you need support for Node 4 or 5, please use version 2.x.x.
|