Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
global.debug = function(val) {
var str;
try {
str = JSON.stringify(val, null, " ");
} catch (e) {
str = sys.inspect(val, null, true);
}
sys.debug(str);
process.exit();
}
// End Compat Layer
exports.info = forLevels(['info', 'debug'], function (label, val) {
if (val === undefined) {
val = label;
label = null;
}
if (typeof val !== 'string') {
val = sys.inspect(val);
}
label ? sys.puts(magenta(label + ' ') + val): sys.puts(val);
});
s3.del({'bucket':b, 'filename': filename}, function(data){
var msg = 'Success! The file was removed. <a href="/bucket?b='+b+'">Back to '+ b +'</a>'
if (data != ''){
msg = sys.inspect(data)
}
res.writeHeader(200, {"Content-Type": "text/html"});
res.write(
''+
''+
''+
msg +
''+
''
);
res.close();
})
};
args.forEach(function (msg) {
if (msg instanceof Error) msg = msg.stack;
if (typeof msg !== "string") msg = sys.inspect(msg, 0, 4);
line.push(msg);
});
sys.error(line.join(" "));
var p = function(obj)
{
var obj_inspect = sys.inspect(obj, true, 100);
sys.puts(obj_inspect);
}