{"id":13800776,"url":"https://github.com/yui/yuicompressor","last_synced_at":"2025-05-14T01:02:37.310Z","repository":{"id":461379,"uuid":"85673","full_name":"yui/yuicompressor","owner":"yui","description":"YUI Compressor","archived":false,"fork":false,"pushed_at":"2021-09-15T08:51:14.000Z","size":6402,"stargazers_count":3016,"open_issues_count":163,"forks_count":663,"subscribers_count":174,"default_branch":"master","last_synced_at":"2025-04-26T12:48:33.842Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://yui.github.com/yuicompressor/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yui.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.TXT","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2008-12-05T19:13:24.000Z","updated_at":"2025-04-23T12:08:22.000Z","dependencies_parsed_at":"2022-07-07T14:38:13.829Z","dependency_job_id":null,"html_url":"https://github.com/yui/yuicompressor","commit_stats":null,"previous_names":[],"tags_count":42,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yui%2Fyuicompressor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yui%2Fyuicompressor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yui%2Fyuicompressor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yui%2Fyuicompressor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yui","download_url":"https://codeload.github.com/yui/yuicompressor/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251596667,"owners_count":21615017,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T00:01:16.197Z","updated_at":"2025-04-29T23:01:37.941Z","avatar_url":"https://github.com/yui.png","language":"Java","readme":"YUI Compressor - The Yahoo! JavaScript and CSS Compressor\n=========================================================\n\nThe YUI Compressor is a JavaScript compressor which, in addition to removing\ncomments and white-spaces, obfuscates local variables using the smallest\npossible variable name. This obfuscation is safe, even when using constructs\nsuch as 'eval' or 'with' (although the compression is not optimal in those\ncases) Compared to jsmin, the average savings is around 20%.\n\nThe YUI Compressor is also able to safely compress CSS files. The decision\non which compressor is being used is made on the file extension (js or css)\n\nBuilding\n--------\n\n    ant\n\nTesting\n-------\n\n    ./tests/suite.sh\n\n\nNode.js Package\n---------------\n\nYou can require compressor in a Node.js package and compress files and strings in async.\n_It still uses Java under the hood_\n\n    npm i yuicompressor\n\n```javascript\n\nvar compressor = require('yuicompressor');\n\ncompressor.compress('/path/to/file or String of JS', {\n    //Compressor Options:\n    charset: 'utf8',\n    type: 'js',\n    nomunge: true,\n    'line-break': 80\n}, function(err, data, extra) {\n    //err   If compressor encounters an error, it's stderr will be here\n    //data  The compressed string, you write it out where you want it\n    //extra The stderr (warnings are printed here in case you want to echo them\n});\n\n```\n\nOptions:\n* `charset` // defaults to 'utf8'\n* `type` // defaults to 'js'\n* `line-break`\n* `nomunge`\n* `preserve-semi`\n* `disable-optimizations`\n\n\nTODO\n----\n\n* Better Docs\n* Help Pages\n\nBuild Status\n------------\n\n[![Build Status](https://secure.travis-ci.org/yui/yuicompressor.svg?branch=master)](http://travis-ci.org/yui/yuicompressor)\n\n\nGlobal Options\n--------------\n\n    -h, --help\n        Prints help on how to use the YUI Compressor\n\n    --line-break\n        Some source control tools don't like files containing lines longer than,\n        say 8000 characters. The linebreak option is used in that case to split\n        long lines after a specific column. It can also be used to make the code\n        more readable, easier to debug (especially with the MS Script Debugger)\n        Specify 0 to get a line break after each semi-colon in JavaScript, and\n        after each rule in CSS.\n\n    --type js|css\n        The type of compressor (JavaScript or CSS) is chosen based on the\n        extension of the input file name (.js or .css) This option is required\n        if no input file has been specified. Otherwise, this option is only\n        required if the input file extension is neither 'js' nor 'css'.\n\n    --charset character-set\n        If a supported character set is specified, the YUI Compressor will use it\n        to read the input file. Otherwise, it will assume that the platform's\n        default character set is being used. The output file is encoded using\n        the same character set.\n\n    -o outfile\n\n        Place output in file outfile. If not specified, the YUI Compressor will\n        default to the standard output, which you can redirect to a file.\n        Supports a filter syntax for expressing the output pattern when there are\n        multiple input files.  ex:\n            java -jar yuicompressor.jar -o '.css$:-min.css' *.css\n        ... will minify all .css files and save them as -min.css\n\n    -v, --verbose\n        Display informational messages and warnings.\n\nJavaScript Only Options\n-----------------------\n\n    --nomunge\n        Minify only. Do not obfuscate local symbols.\n\n    --preserve-semi\n        Preserve unnecessary semicolons (such as right before a '}') This option\n        is useful when compressed code has to be run through JSLint (which is the\n        case of YUI for example)\n\n    --disable-optimizations\n        Disable all the built-in micro optimizations.\n\nNotes\n-----\n\n* If no input file is specified, it defaults to stdin.\n\n* Supports wildcards for specifying multiple input files.\n\n* The YUI Compressor requires Java version \u003e= 1.5.\n\n* It is possible to prevent a local variable, nested function or function\nargument from being obfuscated by using \"hints\". A hint is a string that\nis located at the very beginning of a function body like so:\n    \n```\nfunction fn (arg1, arg2, arg3) {\n    \"arg2:nomunge, localVar:nomunge, nestedFn:nomunge\";\n\n    ...\n    var localVar;\n    ...\n\n    function nestedFn () {\n        ....\n    }\n\n    ...\n}\n```\nThe hint itself disappears from the compressed file.\n\n* C-style comments starting with `/*!` are preserved. This is useful with\n    comments containing copyright/license information. As of 2.4.8, the '!'\n    is no longer dropped by YUICompressor. For example:\n\n```\n/*!\n * TERMS OF USE - EASING EQUATIONS\n * Open source under the BSD License.\n * Copyright 2001 Robert Penner All rights reserved.\n */\n```\n\nremains in the output, untouched by YUICompressor.\n\nModified Rhino Files\n--------------------\n\nYUI Compressor uses a modified version of the Rhino library\n(http://www.mozilla.org/rhino/) The changes were made to support\nJScript conditional comments, preserved comments, unescaped slash\ncharacters in regular expressions, and to allow for the optimization\nof escaped quotes in string literals.\n\nCopyright And License\n---------------------\n\nCopyright (c) 2013 Yahoo! Inc.  All rights reserved.\nThe copyrights embodied in the content of this file are licensed\nby Yahoo! Inc. under the BSD (revised) open source license.\n","funding_links":[],"categories":["Java","Minifiers - JS \u0026 CSS","VI. Program languages and applications that were written with Java"],"sub_categories":["Meetups","3. Javascript"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyui%2Fyuicompressor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyui%2Fyuicompressor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyui%2Fyuicompressor/lists"}