replace
replace copied to clipboard
Replace all
How to replace all content of a file with same text ?
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!