pc__search_string_in_js

This is plugin for nmp-package "Post-Compression". He's searching for the quoting strings in JS code.

Usage no npm install needed!

<script type="module">
  import pcSearchStringInJs from 'https://cdn.skypack.dev/pc__search_string_in_js';
</script>

README

Search the quotied strings in JS

This is plugin for nmp-package "Post-Compression".
Search the quotied strings the in JS code.

An example of using:

var searchStringInJS = require("pc__search_string_in_js"),
    uniqueNames = {};

gulp.src("./*.js")
    .pipe(postCompression.search([
        searchStringInJS()
    ], uniqueNames));  

Where:

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

An example of JS code:

t.triggerEvent("update",null);
g.addEvent("update_hash", function() {});

An example of a result searching:

{
    "update": 1,
    "update_hash": 1
}