replace-string-if
Version:
If the callback is true, perform string replacement.
21 lines (9 loc) • 392 B
Markdown
This is a transform stream. If the condition passed evaluates to true, a string replace is run on the stream.
npm install replace-string-if
var condition = function () { return true; };
var match = 'expression';
var replacement = 'newexpression';
var replaceStringIf(condition(), match, replacement);