Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Munch.js is a utility that rewrites classes and ids in CSS, HTML, and JavaScript files in order to save precious bytes and obfuscate your code.
Munch.js is a utility that rewrites classes and ids in CSS, HTML, and JavaScript files in order to save precious bytes and obfuscate your code. based on Craig Campbell's HTML-Muncher.
Install by using npm install -g munch
This module uses Hashids to generate the class and ID names. Just to look more googly.
Please take note that I am not confident that this library is perfect for every kind of project out there. please use sparingly.
This library was made solely for the deployment process, and is done at the first steps before minifying the assets
This is a command line utility so it is preferred that you install this globally using the -g
flag.
You can run munch
using the format below
munch --css file1.css,/path/to/css1,file2.css,file3.css --view /path/to/views1,file1.html,/path/to/views2/,file3.html --js main.js,/path/to/js
html files to rewrite (comma separated list of directories and files)
css files to rewrite (comma separated list of directories and files)
js files to rewrite (comma separated list of directories and files)
a file where all options available for muncher are stored. this can be any json files or a .muncher file by default. useful for deployment purposes.
sets the extension to look for in the view directory (defaults to html)
sets the extension to look for in the css directory (defaults to css)
sets the extension to look for in the js directory (defaults to js)
comma separated list of classes or ids to ignore when rewriting css (ie .sick_class, #sweet_id)
strips new line characters to compress html files specified with --html
strips new line characters to compress css files specified with --css
writes all mapped ids and classes into a file specified
uses all the mapped ids and classes in a specified file to be used as a dictionary for the rewrite process
modules for parsing and writing (comma separated list of module names) check out https://github.com/jmrocela/munch-jquery for an example.
will output how many bytes were saved by munching
do not output any information about the process (not recommended)
FAQs
Munch.js is a utility that rewrites classes and ids in CSS, HTML, and JavaScript files in order to save precious bytes and obfuscate your code.
We found that munch demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.