You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Jun 15, 2021. It is now read-only.
varfs=require('fs')varem=require('ender-minify')varoptions={}// no options for UglifyJS at the momentfs.readFile('source.js','utf-8',function(err,source){if(err)throwerrem('uglify',source,options,function(err,minifiedSource){if(err)throwerrfs.writeFile('source.min.js',minifiedSource,'utf-8')})})
varfs=require('fs')varem=require('ender-minify')varoptions={level: 'simple',// can be 'whitespace', 'simple' or 'advanced'externs: ['foo.js','bar.js']// passed as --externs}fs.readFile('source.js','utf-8',function(err,source){if(err)throwerrem('closure',source,options,function(err,minifiedSource){if(err)throwerrfs.writeFile('source.min.js',minifiedSource,'utf-8')})})
YUICompressor coming soon...
enderMinify.minifiers
A list of minifiers available as an array.
enderMinify.closureLevels
An object with mappings of the Closure Compiler compression levels, from nice-key to verbose-Closure-key.
The absolute path name to the closure.jar file used to run Closure Compiler within this package. Useful if you wanted to call it directly.
Contributing
Contributions are more than welcome! Just fork and submit a GitHub pull request! If you have changes that need to be synchronized across the various Ender CLI repositories then please make that clear in your pull requests.
Tests
Ender Minify uses Buster for unit testing. You'll get it (and a bazillion unnecessary dependencies) when you npm install in your cloned local repository. Simply run npm test to run the test suite.
Licence
Ender Minify is Copyright (c) 2012 @rvagg, @ded, @fat and other contributors. It is licenced under the MIT licence. All rights not explicitly granted in the MIT license are reserved. See the included LICENSE file for more details.
About
Bundled minifier utilities for Node, designed primarily for use with the Ender CLI.