gulp-inject-string icon indicating copy to clipboard operation
gulp-inject-string copied to clipboard

Ability to use an object for performing many replacements in a single call

Open garrypas opened this issue 8 years ago • 0 comments

I modified the replace function to take a dictionary of key/value pairs as a JSON object and replace them all in one go. For example I have a file with various placeholders that I want to transform. Hopefully this will be useful to other users of this project.

gulpInjectString.replace({
  "{{ key1 }}": "value 1",
  "{{ key2 }}": "value 2"
  // ... etc ...
})

garrypas avatar Oct 28 '16 13:10 garrypas