replace-in-file icon indicating copy to clipboard operation
replace-in-file copied to clipboard

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

Results 33 replace-in-file issues
Sort by recently updated
recently updated
newest added

It would be great if this library could provide a changelog for each version.

Steps to reproduce: Setup a from string with parenthesis ie. `app.setVersion('${sourceVersion}');` Run the replacement Check the output value for `numReplacements` and `numMatches`, it will be 0, however the change was...

I'd love to be able to set a `toFiles` option. Eg. ```js const options = { files: 'path/to/files/*.html', toFiles: fileName => `new/path/${fileName}` } ``` Cheers!!

PR welcome
feature
8.0

I am not sure if it worked in the past, I think it did. If it has anything to do with node version or this package, but it does not...

Bumps [minimist](https://github.com/substack/minimist) from 1.2.5 to 1.2.6. Commits 7efb22a 1.2.6 ef88b93 security notice for additional prototype pollution issue c2b9819 isConstructorOrProto adapted from PR bc8ecee test from prototype pollution PR See full...

dependencies

In fact, many projects has installing glob packages, and glob package are not needed when glob is turned off(disabledGlob). Therefore, I personally believe that Glob can be used as a...

https://github.com/adamreisnz/replace-in-file/blob/main/lib/helpers/make-replacements.js#L43 need add : ```ts if (typeof item === 'string') item = new RegExp(item, 'g') ```

Thank you for your module. I use your module [in package.json scripts](https://github.com/viT-1/dist-gh-pages/blob/7b9cf0a1902e262b4cd0aa9760b3a99e68bd8816/package.json#L19): `"scripts": { "replacestr": "replace-in-file ./dist/index.html --configFile=./replace-in-file.config.js" }` On modern way node can use esm scripts. Are you planning...

feature
8.0

My implementation is as follows: ```js import replace from "replace-in-file"; const results = await replace.replaceInFile({ files: './src/main/resources/templates/*.html', countMatches: true, dry: true, processor: (input) => input.split('\r\n').map(line => { //add th reference...