- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Which one is the Python module to obfuscate javascript?
You can use the jsmin module to minimize/obfuscate javascript code using Python. Install jsmin using:
$ pip install jsmin
To use jsmin in your python project to minimize a js file, say hello.js, you can use it as follows:
>>> from jsmin import jsmin >>> with open('hello.js') as js_file: ... minified = jsmin(js_file.read()) >>> print minified
You'll get the minified JS code printed to your shell. You can also use jsmin as a command line tool:
$ python -m jsmin hello.js
You can read more about jsmin on pypi docs: https://pypi.python.org/pypi/jsmin
- Related Articles
- How to understand JavaScript module pattern?
- What is calendar module in python?
- The time Module in Python
- The calendar Module in Python
- The Threading Module in Python
- How to use the Subprocess Module in Python?
- Python getpass Module
- What is Python module for date manipulation?
- What is Python's OS Module
- What is Python's Sys Module
- How to retrieve Python module path?
- How to write a python module?
- How to install a Python Module?
- How to develop a Python Module?
- What is the difference between a python module and a python package?

Advertisements