Replace In File Versions Save

A simple utility to quickly replace contents in one or more files

v4.0.0

5 years ago

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

v3.1.0

6 years ago
  • 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.

v3.0.0

6 years ago
  • 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

v3.0.0-beta.2

6 years ago
  • Passing filename as last parameter for replace callback functions

v3.0.0-beta.1

6 years ago
  • 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