pc__replace_words_in_js

0.0.1 • Public • Published

Replace words in JS

This is plugin for nmp-package "Post-Compression".
He`s searching and replaces long words on short words, in the JS code.

An example of using:

var replaceWordsInJS = require("pc__replace_words_in_js");
 
gulp.src("./*.js")
    .pipe(postCompression.search([
        replaceWordsInJS()
    ], shortNames));

Where:

  • shortNames - an object of type JSON with rules replace the long words to short words.

An example of the JSON object "shortNames":

{
    "words_in_js": {        // the name of the group names
        "core": "a",        // long name: short name
        "_createScope": "b"
    }
}

An example of JS code before:

...e.core||{}}};e._createScope();for(...

An example of JS code after:

...e.a||{}}};e.b();for(...

Package Sidebar

Install

npm i pc__replace_words_in_js

Weekly Downloads

0

Version

0.0.1

License

none

Last publish

Collaborators

  • bakhirev