Skip to content

Instantly share code, notes, and snippets.

@craiglonsdale
Created June 25, 2015 00:25
Show Gist options
  • Select an option

  • Save craiglonsdale/7fe73bce59e971756862 to your computer and use it in GitHub Desktop.

Select an option

Save craiglonsdale/7fe73bce59e971756862 to your computer and use it in GitHub Desktop.
replaceColour
module.exports.replaceTargetColour = function (target_colour, repleacement_colours) {
var replaceColour = function(file, enc, callback) {
if (file.IsNull) {
return callback(null, file);
}
function replaceColour() {
if (file.isStream()) {
file.contents = file.contents.pipe(replace(target_colour, repleacement_colours));
return callback(null, file);
}
}
replaceColour();
}
return through.obj(replaceColour)
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment