GithubHelp home page GithubHelp logo

crunchme's Introduction

Crunchme

This utility compresses your .js into a self extracting file and appends minimal JavaScript required to decompress the file.

It uses several algorithms to find the best solution or even leave the file as is, if compression overhead will actually increase the files size.

This file does not use minification tools like uglify-js, you have to apply that yourself before using this module.

For better compression rates use this excellent tool instead.

Usage

Using command line:

crunchme file.js file.bin.js

Programmatically:

var crunchme = require("crunchme");
var output = crunchme(js_code);

License

This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means.

In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to http://unlicense.org/

crunchme's People

Contributors

streamich avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

baysao mikalv

crunchme's Issues

usability inside browser

Hi there,
Love your tool so far!
I just discovered crunchme because I'd like to compress some JS further beyond what uglify-es/js can do.

However it seems like the compressed js crunchme creates has to be run via a node environment. At least it seemed that way for a quick test I made, where the output was using nodes zlib.
After that, I looked around a bit in the algo directory and discovered there where a few other algorithms you included that appear to have no dependency on node (no require()).

So my questions are:

  • can I use crunchme with only those other algs (lz77, lzw) that don't rely on node to generate compressed code that runs in the browser?

  • if that is the case, how would you recommend excluding the algorithms that require node/zlib. By hand in source, or is there a command line flag present?

  • could I still use the other algos by push the code that has require in it through eg. browserify, or webpack or would they become to huge to make a difference in the end?

I'll try to experiment a bit more with crunchme either way. Thanks for the tool!

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.