Coder Social home page Coder Social logo

jsmin's Introduction

jsmin

JavaScript minifier.

Usage

from jsmin import jsmin
with open('myfile.js') as js_file:
    minified = jsmin(js_file.read())

You can run it as a commandline tool also:

python -m jsmin myfile.js

NB: jsmin makes no attempt to be compatible with ECMAScript 6 / ES.next / Harmony. The current maintainer does not intend to add ES6-compatibility. If you would like to take over maintenance and update jsmin for ES6, please contact Tikitu de Jager. Pull requests are also welcome, of course, but my time to review them is somewhat limited these days.

If you're using jsmin on ES6 code, though, you might find the quote_chars parameter useful:

from jsmin import jsmin
with open('myfile.js') as js_file:
    minified = jsmin(js_file.read(), quote_chars="'\"`")

Where to get it

Python 2 support removed

Python 2 support was removed in version 3.0.0. If you need to support Python 2, please use version 2.2.2 with setuptools<58.

Contributing

Issues and Pull requests will be gratefully received on Github. The project used to be hosted on bitbucket and old issues can still be found there.

If possible, please make separate pull requests for tests and for code: tests will be added to the latest-release branch while code will go to master.

Unless you request otherwise, your Github identity will be added to the contributor's list below; if you prefer a different name feel free to add it in your pull request instead. (If you prefer not to be mentioned you'll have to let the maintainer know somehow.)

Build/test status

Both branches are tested with Travis: https://travis-ci.org/tikitu/jsmin

The latest-release branch (the version on PyPI plus any new tests) is tested against CPython 3. Currently:

https://travis-ci.org/tikitu/jsmin.png?branch=latest-release

If that branch is failing that means there's a new test that fails on the latest released version on pypi, with no fix yet released.

The master branch (development version, might be ahead of latest released version) is tested against CPython 3. Currently:

https://travis-ci.org/tikitu/jsmin.png?branch=master

If master is failing don't use it, but as long as latest-release is passing the pypi release should be ok.

Contributors (chronological commit order)

jsmin's People

Contributors

albertyw avatar danudey avatar davidjb avatar moggers87 avatar ncalexan avatar rennat avatar serenecloud avatar soulseekah avatar sunpoet avatar tikitu avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.