pc__replace_use_regexp
v0.0.1
Published
This is plugin for nmp-package "Post-Compression". He is searching and replaces the string according to the RegExp.
Downloads
7
Maintainers
Readme
Replace something according to the RegExp
This is plugin for nmp-package "Post-Compression".
He is searching and replaces the string according to the RegExp
An example of using:
var replaceUseRegExp = require("pc__replace_use_regexp");
gulp.src("./*.js")
.pipe(postCompression.replace([
replaceUseRegExp([
[ /\s{2,}/gim, "" ], // first element - regExp, second element - new string
[ /(\r|\n)/gim, "" ],
[ /\:\s/gim, ":" ]
])
], shortNames));
An example of JS code before:
...;return " right: "+o+x;}...
An example of JS code after:
...;return "right:"+o+x;}...