How to use the sys.inspect function in sys

To help you get started, we’ve selected a few sys examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jsdom / jsdom / test / runner.js View on Github external
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
github caolan / cpm / lib / logger.js View on Github external
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);
});
github grippy / node-s3 / app.js View on Github external
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();
        })
    };
github yui / yeti / lib / old / ui.js View on Github external
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(" "));
github mixflame / js2cs / js2cs.js View on Github external
var p = function(obj)
{
var obj_inspect = sys.inspect(obj, true, 100);
sys.puts(obj_inspect);
}

sys

Fixes using sys in your libraries without require all of Node to not depreciate stuff. Jeez.

BSD
Latest version published 12 years ago

Package Health Score

40 / 100
Full package analysis