Skip to content

Releases: adamreisnz/replace-in-file

4.0.0

Choose a tag to compare

@adamreisnz adamreisnz released this 21 Apr 01:06

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

Choose a tag to compare

@adamreisnz adamreisnz released this 20 Dec 18:28
  • 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

Choose a tag to compare

@adamreisnz adamreisnz released this 20 Dec 18:25
  • 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

3.0.0-beta.2 Pre-release
Pre-release

Choose a tag to compare

@adamreisnz adamreisnz released this 14 Sep 21:33
  • Passing filename as last parameter for replace callback functions

3.0.0-beta.1

3.0.0-beta.1 Pre-release
Pre-release

Choose a tag to compare

@adamreisnz adamreisnz released this 14 Sep 02:46
  • 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