Merge pull request #94 from paulmillr/patch-1
Add better fromstring docs.
This commit is contained in:
@@ -335,9 +335,10 @@ There's a single toplevel function which combines all the steps. If you
|
|||||||
don't need additional customization, you might want to go with `minify`.
|
don't need additional customization, you might want to go with `minify`.
|
||||||
Example:
|
Example:
|
||||||
|
|
||||||
// see "fromString" below if you need to pass code instead of file name
|
|
||||||
var result = UglifyJS.minify("/path/to/file.js");
|
var result = UglifyJS.minify("/path/to/file.js");
|
||||||
console.log(result.code); // minified output
|
console.log(result.code); // minified output
|
||||||
|
// if you need to pass code instead of file name
|
||||||
|
var result = UglifyJS.minify("var b = function () {};", {fromString: true});
|
||||||
|
|
||||||
You can also compress multiple files:
|
You can also compress multiple files:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user