Skip to content
This repository has been archived by the owner on Sep 26, 2023. It is now read-only.

Replace all #61

Open
marcoturi opened this issue Mar 10, 2017 · 1 comment
Open

Replace all #61

marcoturi opened this issue Mar 10, 2017 · 1 comment

Comments

@marcoturi
Copy link

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

@zchsh
Copy link

zchsh commented Jan 10, 2018

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!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants