Skip to content

Proposal: [API Reference] Write Compressed Code To File #96

@akhabibullina

Description

@akhabibullina

Hello,

When use the library from JavaScript, one can specify the file name to read code from. For example, for "minify" function:

var result = UglifyJS.minify("/path/to/file.js");

Thus, usually a dev doesn't care about manual reading code from the file.
On the contrary, the library doesn't support saving compressed code string to a file. Hence, if the developer needs minified code to be writen in the output file then he/she will also add something like:

// Output to a file
var fs = require('fs');
fs.writeFile(""/path/to/output/file.js", result.code, function(err) {
if(err) {
console.log(err);
} else {
console.log("The file was saved!");
}
});

I propose to add an appropriate option to output object which a programmer may pass as an argument to emit an output file with compressed result code.

Thanks,
Anna.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions