replace icon indicating copy to clipboard operation
replace copied to clipboard

Replace all

Open marcoturi opened this issue 8 years ago • 1 comments

How to replace all content of a file with same text ?

marcoturi avatar Mar 10 '17 17:03 marcoturi

Are you using replace from the command line, or within another script? If you're using it in a script, you can easily use a regex to perform a global replace.

var replace = require("replace");

replace({
  regex: /foo/g, // NOT "foo"
  replacement: "bar",
  paths: ['.'],
  recursive: true,
  silent: false,
});

For the command line, I'm not sure 'cause I haven't used it 😬 Let me know if that helps!

zchsh avatar Jan 10 '18 21:01 zchsh