Skip to content

Releases: adamreisnz/replace-in-file

4.0.0

21 Apr 01:06
Compare
Choose a tag to compare

Breaking changes

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.

To update existing code and obtain an array of changed files again, simply convert the results array as follows:

const results = await replace(options);
const changedFiles = results
  .filter(result => result.hasChanged)
  .map(result => result.file);

New features

  • Added countMatches flag to count the number of matches and replacements per file #38, #42, #61
  • Added --quiet flag for CLI to suppress success output #63
  • Added cwd configuration parameter for network drive replacements #56

3.1.0

20 Dec 18:28
Compare
Choose a tag to compare
  • Config file path passed to CLI can now be absolute (#37)
  • Update dependencies

Note: potentially breaking if you were passing in a config file path which was absolute and relying on the undocumented behaviour that this would be appended to the current working directory. If you encounter issues with this, simply change your config file path from absolute to relative, by removing the leading slash from it.

3.0.0

20 Dec 18:25
Compare
Choose a tag to compare
  • Drop deprecated API
  • Drop support for Node 4 and 5
  • Refactor and clean up code base
  • Leverage destructuring
  • Option to disable globs (#32)
  • Update and clean up readme

3.0.0-beta.2

14 Sep 21:33
Compare
Choose a tag to compare
3.0.0-beta.2 Pre-release
Pre-release
  • Passing filename as last parameter for replace callback functions

3.0.0-beta.1

14 Sep 02:46
Compare
Choose a tag to compare
3.0.0-beta.1 Pre-release
Pre-release
  • Drop deprecated API
  • Drop support for Node 4 and 5
  • Refactor and clean up code base
  • Leverage destructuring
  • Option to disable globs (#32)
  • Update and clean up readme