node-obfuscator icon indicating copy to clipboard operation
node-obfuscator copied to clipboard

Request for an option to output the concatenated source so uglifyjs warning can be taken care of more easily

Open shiwanlin opened this issue 9 years ago • 2 comments

Not a high priority but a nicety to have an option to output the concatenated source so uglifyjs warning can be taken care of more easily, say, in utils.js,

exports.uglify = function (js, opts, cb) {
...
    return cb(null,  stream.toString(), js);
...
}

with the source output, the line number from the uglifyjs warning can be easily found:

WARN: Non-strict equality against boolean: != true [null:3470,6]

BTW, obfuscator is a great tool!

shiwanlin avatar Jan 12 '16 04:01 shiwanlin

I took a quick look at the source, and this is already possible, as such:

var options = {}; // build options as per documentation
var obfuscator = require('obfuscator').obfuscator;
var concatenate = obfuscator.concatenate;

concatenate(options, function(err, concatenated) {
    if (err) { throw err; }

    fs.writeFileSync('concatenated.js', concatenated);
    // or, you know, do whatever you like
});

catdad avatar Jan 17 '16 00:01 catdad

That's cool - thanks!

shiwanlin avatar Jan 17 '16 01:01 shiwanlin