You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
666 B
17 lines
666 B
//convienence function(src, [options]); |
|
function uglify(orig_code, options){ |
|
options || (options = {}); |
|
var jsp = uglify.parser; |
|
var pro = uglify.uglify; |
|
|
|
var ast = jsp.parse(orig_code, options.strict_semicolons); // parse code and get the initial AST |
|
ast = pro.ast_mangle(ast, options.mangle_options); // get a new AST with mangled names |
|
ast = pro.ast_squeeze(ast, options.squeeze_options); // get an AST with compression optimizations |
|
var final_code = pro.gen_code(ast, options.gen_options); // compressed code here |
|
return final_code; |
|
}; |
|
|
|
uglify.parser = require("./lib/parse-js"); |
|
uglify.uglify = require("./lib/process"); |
|
|
|
module.exports = uglify |