Python 3 SlimIt Library Script to Compress or Minify Javascript Source Code Full Project For Beginners

 

Welcome folks today in this blog post we will be compressing or minifying javascript source code in python.All the full source code of the application is shown below.

 

 

 

Get Started

 

 

 

In order to get started you need to install the below library using the pip command as shown below

 

 

pip install slimit

 

 

After installing this library you need to make an app.py file and copy paste the following code

 

 

app.py

 

 

from slimit import minify
text = """
var a = function( obj ) {
         for ( var name in obj ) {
                 return false;
         }
         return true;
};
"""
print(minify(text, mangle=True))

Leave a Reply