1.0.3 • Published 2 years ago

easy-replace-in-files v1.0.3

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

easy-replace-in-files

Simple tool for find and replace in files. Uses config file for files, from and to rules.

Install

npm install --save-dev easy-replace-in-files

Example

Create config file easy-replace-in-files.json

{
  "easyReplaceInFiles": [
    {
      "files": "readme.txt",
      "from": "Stable tag:\\s?(.+)",
      "type": "regex",
      "to": "Stable tag: $$npm_package_version$$"
    }
  ]
}

In package.json scripts

"scripts" : {
  "version": "easy-replace-in-files",
}

In the terminal, run

npm run version