pc__replace_use_regexp

0.0.1 • Public • Published

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;}...

Package Sidebar

Install

npm i pc__replace_use_regexp

Weekly Downloads

0

Version

0.0.1

License

none

Last publish

Collaborators

  • bakhirev