Skip to main content

Javascript Minifier

Project description

rJSmin is a javascript minifier written in python.

The minifier is based on the semantics of jsmin.c by Douglas Crockford.

The module is a re-implementation aiming for speed, so it can be used at runtime (rather than during a preprocessing step). Usually it produces the same results as the original jsmin.c. It differs in the following ways:

  • there is no error detection: unterminated string, regex and comment literals are treated as regular javascript code and minified as such.

  • Control characters inside string and regex literals are left untouched; they are not converted to spaces (nor to n)

  • Newline characters are not allowed inside string and regex literals, except for line continuations in string literals (ECMA-5).

  • “return /regex/” is recognized correctly.

  • More characters are allowed before regexes.

  • Line terminators after regex literals are handled more sensibly

  • “+ +” and “- -” sequences are not collapsed to ‘++’ or ‘–’

  • Newlines before ! operators are removed more sensibly

  • (Unnested) template literals are supported (ECMA-6)

  • Comments starting with an exclamation mark (!) can be kept optionally

  • rJSmin does not handle streams, but only complete strings. (However, the module provides a “streamy” interface).

Since most parts of the logic are handled by the regex engine it’s way faster than the original python port of jsmin.c by Baruch Even. The speed factor varies between about 6 and 55 depending on input and python version (it gets faster the more compressed the input already is). Compared to the speed-refactored python port by Dave St.Germain the performance gain is less dramatic but still between 3 and 50 (for huge inputs)). See the docs/BENCHMARKS file for details.

rjsmin.c is a reimplementation of rjsmin.py in C and speeds it up even more.

Supported python versions are 2.7 and 3.6+.

Bugs

No bugs, of course. ;-) But if you’ve found one or have an idea how to improve rjsmin, feel free to send a pull request on github or send a mail to <rjsmin-bugs@perlig.de>.

Author Information

André “nd” Malo <nd perlig.de> GPG: 0x029C942244325167

If God intended people to be naked, they would be born that way. – Oscar Wilde

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rjsmin-1.2.1.tar.gz (420.7 kB view details)

Uploaded Source

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

rjsmin-1.2.1-cp311-cp311-manylinux2014_aarch64.whl (32.2 kB view details)

Uploaded CPython 3.11

rjsmin-1.2.1-cp311-cp311-manylinux1_x86_64.whl (31.7 kB view details)

Uploaded CPython 3.11

rjsmin-1.2.1-cp311-cp311-manylinux1_i686.whl (31.8 kB view details)

Uploaded CPython 3.11

rjsmin-1.2.1-cp310-cp310-manylinux2014_aarch64.whl (30.7 kB view details)

Uploaded CPython 3.10

rjsmin-1.2.1-cp310-cp310-manylinux1_x86_64.whl (34.9 kB view details)

Uploaded CPython 3.10

rjsmin-1.2.1-cp310-cp310-manylinux1_i686.whl (34.9 kB view details)

Uploaded CPython 3.10

rjsmin-1.2.1-cp39-cp39-manylinux2014_aarch64.whl (30.2 kB view details)

Uploaded CPython 3.9

rjsmin-1.2.1-cp39-cp39-manylinux1_x86_64.whl (28.9 kB view details)

Uploaded CPython 3.9

rjsmin-1.2.1-cp39-cp39-manylinux1_i686.whl (28.7 kB view details)

Uploaded CPython 3.9

rjsmin-1.2.1-cp38-cp38-manylinux2014_aarch64.whl (30.7 kB view details)

Uploaded CPython 3.8

rjsmin-1.2.1-cp38-cp38-manylinux1_x86_64.whl (29.1 kB view details)

Uploaded CPython 3.8

rjsmin-1.2.1-cp38-cp38-manylinux1_i686.whl (28.9 kB view details)

Uploaded CPython 3.8

rjsmin-1.2.1-cp37-cp37m-manylinux2014_aarch64.whl (31.3 kB view details)

Uploaded CPython 3.7m

rjsmin-1.2.1-cp37-cp37m-manylinux1_x86_64.whl (29.8 kB view details)

Uploaded CPython 3.7m

rjsmin-1.2.1-cp37-cp37m-manylinux1_i686.whl (29.6 kB view details)

Uploaded CPython 3.7m

rjsmin-1.2.1-cp36-cp36m-manylinux2014_aarch64.whl (30.3 kB view details)

Uploaded CPython 3.6m

rjsmin-1.2.1-cp36-cp36m-manylinux1_x86_64.whl (28.8 kB view details)

Uploaded CPython 3.6m

rjsmin-1.2.1-cp36-cp36m-manylinux1_i686.whl (28.6 kB view details)

Uploaded CPython 3.6m

rjsmin-1.2.1-cp27-cp27mu-manylinux1_x86_64.whl (27.8 kB view details)

Uploaded CPython 2.7mu

rjsmin-1.2.1-cp27-cp27mu-manylinux1_i686.whl (27.5 kB view details)

Uploaded CPython 2.7mu

rjsmin-1.2.1-cp27-cp27m-manylinux1_x86_64.whl (27.8 kB view details)

Uploaded CPython 2.7m

rjsmin-1.2.1-cp27-cp27m-manylinux1_i686.whl (27.6 kB view details)

Uploaded CPython 2.7m

File details

Details for the file rjsmin-1.2.1.tar.gz.

File metadata

  • Download URL: rjsmin-1.2.1.tar.gz
  • Upload date:
  • Size: 420.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.10.5

File hashes

Hashes for rjsmin-1.2.1.tar.gz
Algorithm Hash digest
SHA256 1f982be8e011438777a94307279b40134a3935fc0f079312ee299725b8af5411
MD5 3c7133906b59b517defae26e614f4d9b
BLAKE2b-256 8c76f0236a34a2c7f49f5b1f59f4b6fda769fc2bf7f90d0aac4cbebbb465646d

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp311-cp311-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp311-cp311-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f0895b360dccf7e2d6af8762a52985e3fbaa56778de1bf6b20dbc96134253807
MD5 31bd3b40737c3016f46c694ece3f7524
BLAKE2b-256 471ac7a83e1056e3688d92ff8a834c7bb28f47af56cda77bcf24f998c9379c2f

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp311-cp311-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp311-cp311-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 7dd58b5ed88233bc61dc80b0ed87b93a1786031d9977c70d335221ef1ac5581a
MD5 899d846d23604f64d6a84c93c3e44f03
BLAKE2b-256 29be427af5875f63e6ca4f717285a36fd3f377665dacc0a57d3ea68a937296a4

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp311-cp311-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp311-cp311-manylinux1_i686.whl
Algorithm Hash digest
SHA256 ca90630b84fe94bb07739c3e3793e87d30c6ee450dde08653121f0d9153c8d0d
MD5 fa7a86f70c3f4956727d0badd8d04eaf
BLAKE2b-256 12150ef5339fe04b50e8957f11eadb61a2621338736a195f1e8b9a390b14fa25

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp310-cp310-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp310-cp310-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 35f21046504544e2941e04190ce24161255479133751550e36ddb3f4af0ecdca
MD5 ff6f141421b89afece0785311522a194
BLAKE2b-256 ffee7a3d9eccb83c8f6d809c612f2f688d00a40dd3c98ae4228f51fe7576ee1d

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp310-cp310-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp310-cp310-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bc5bc2f94e59bc81562c572b7f1bdd6bcec4f61168dc68a2993bad2d355b6e19
MD5 c0290c332616e0a9bf1b17683b76ec10
BLAKE2b-256 078df31ff32596749e5303269ebfd2a1654558dcbac381bd823af06c8ece1c6c

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp310-cp310-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp310-cp310-manylinux1_i686.whl
Algorithm Hash digest
SHA256 99c074cd6a8302ff47118a9c3d086f89328dc8e5c4b105aa1f348fb85c765a30
MD5 3e6c1a61e5d843d09f64cd38f6709642
BLAKE2b-256 0f8e3385038115b2ee7f35de7f9ecaa69498ba791e6bf636b8cb08dc85913b0d

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp39-cp39-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp39-cp39-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 8a6710e358c661dcdcfd027e67de3afd72a6af4c88101dcf110de39e9bbded39
MD5 357be276f48e2f7e191b52fb6bece6f6
BLAKE2b-256 8e42504e27f28ffbac2df45aaee995b1b57a69792a2ed1bf0865ccb8fbd6eb50

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp39-cp39-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp39-cp39-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 122aa52bcf7ad9f12728d309012d1308c6ecfe4d6b09ea867a110dcad7b7728c
MD5 2e032afe479deb1fda560668e4b90967
BLAKE2b-256 083350a9609923e84d9178ba7ec41295c2f26fe7d4b46934ddc65c69ddee1a7e

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp39-cp39-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp39-cp39-manylinux1_i686.whl
Algorithm Hash digest
SHA256 113132a40ce7d03b2ced4fac215f0297338ed1c207394b739266efab7831988b
MD5 e3a7e3523b10d9217e7845d24101686d
BLAKE2b-256 919ace1c8b8a79be286b3607bdf3ac3cad1c61c681bca0b50a2fb1d7e49a75b4

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 d332e44a1b21ad63401cc7eebc81157e3d982d5fb503bb4faaea5028068d71e9
MD5 68d7de5d1a3720263a340fe3101f9606
BLAKE2b-256 7d0fc4d3918f4eedb3ec2f370c722eb47250c2bc401f2bb0a3a3b2d446338cb7

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp38-cp38-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp38-cp38-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 5d67ec09da46a492186e35cabca02a0d092eda5ef5b408a419b99ee4acf28d5c
MD5 621ff2ef5453c101a046b81b65290be9
BLAKE2b-256 fa24ca5a2feed243bda32a26fbe35309a678e2c2d135489b231665a8a0163df5

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp38-cp38-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp38-cp38-manylinux1_i686.whl
Algorithm Hash digest
SHA256 eb770aaf637919b0011c4eb87b9ac6317079fb9800eb17c90dda05fc9de4ebc3
MD5 9d52c50ebb9231453250e2aae44d49e3
BLAKE2b-256 2d8a5bc3dcc481a8ccf8115471258e2e0bce4aad6362d86bc205bbe98c66ee78

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp37-cp37m-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp37-cp37m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 bbd7a0abaa394afd951f5d4e05249d306fec1c9674bfee179787674dddd0bdb7
MD5 d89389e7c31508eca7dc162e3042b25d
BLAKE2b-256 9657b95951abfc7910f56018531fc40384a9633fd9b86a44b2770438a8cc1d8a

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp37-cp37m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp37-cp37m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 145c6af8df42d8af102d0d39a6de2e5fa66aef9e38947cfb9d65377d1b9940b2
MD5 ead42631f4c93aa8ad626c09fd409687
BLAKE2b-256 202e8715637a1433ba273e41c5ebc69d9d426949508212d23cae697aca013a98

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp37-cp37m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp37-cp37m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 8c340e251619c97571a5ade20f147f1f7e8664f66a2d6d7319e05e3ef6a4423c
MD5 f1fd5036476af83a9bc047df454bf76e
BLAKE2b-256 d70ae36da6ee5c2f02a0253b8534701149287f70ce29eaf88ae7209a108b0d78

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp36-cp36m-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp36-cp36m-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 3453ee6d5e7a2723ec45c2909e2382371783400e8d51952b692884c6d850a3d0
MD5 765a3c6bb46bea27b479fe68fbdfb24f
BLAKE2b-256 4ba7215cb7978fe0f3d670f8bd44f3ab6e720d90ed4ecbefe314577a14079ea4

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp36-cp36m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp36-cp36m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 f7cd33602ec0f393a0058e883284496bb4dbbdd34e0bbe23b594c8933ddf9b65
MD5 43f91b4381c045d533fc1dcd6c730719
BLAKE2b-256 2075e25ce34073487361d4bb1ec01e3cc58380520a88c9c9043d68a4ece5760b

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp36-cp36m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp36-cp36m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 747bc9d3bc8a220f40858e6aad50b2ae2eb7f69c924d4fa3803b81be1c1ddd02
MD5 e16e92a150f5aea4c537df37811cc499
BLAKE2b-256 48085349b8da3e02961f91a678da2c35d1b7cd29a2cb1cc100e670300a9375ed

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp27-cp27mu-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp27-cp27mu-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 bd1faedc425006d9e86b23837d164f01d105b7a8b66b767a9766d0014773db2a
MD5 fbb050fadec353a7db36477357421d4b
BLAKE2b-256 5176634a5feb933c850431aefce1264e2d5e7bddbedf066207829f466371366f

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp27-cp27mu-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp27-cp27mu-manylinux1_i686.whl
Algorithm Hash digest
SHA256 b8464629a18fe69f70677854c93a3707976024b226a0ce62707c618f923e1346
MD5 518ff394463503d50ec44f100eaf098f
BLAKE2b-256 4ec50fa56f9f1658dd40a46ed9528dd4b700a81a2ecf1eace2b6c3fd30d12d51

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp27-cp27m-manylinux1_x86_64.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp27-cp27m-manylinux1_x86_64.whl
Algorithm Hash digest
SHA256 812af25c08d6a5ae98019a2e1b47ebb47f7469abd351670c353d619eaeae4064
MD5 ed2f4c11b17b6b86a92fbd312bf18f41
BLAKE2b-256 6705b634ea5a3da561dc5b8a1d1c7a4a7fadcc020eded679f21907b579cd5b2f

See more details on using hashes here.

File details

Details for the file rjsmin-1.2.1-cp27-cp27m-manylinux1_i686.whl.

File metadata

File hashes

Hashes for rjsmin-1.2.1-cp27-cp27m-manylinux1_i686.whl
Algorithm Hash digest
SHA256 35827844d2085bd59d34214dfba6f1fc42a215c455887437b07dbf9c73019cc1
MD5 f5258843315f9b603ddfbc7bce2353e6
BLAKE2b-256 a1d7b5d169dad1566fab5b62b4ec8640713950d98f9343acf3e23918e7f6c58e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page