p.js 433 B

123456789101112131415161718
  1. var utils = require('../utils')
  2. , nodes = require('../nodes');
  3. /**
  4. * Inspect the given `expr`.
  5. *
  6. * @param {Expression} expr
  7. * @api public
  8. */
  9. (module.exports = function p(){
  10. [].slice.call(arguments).forEach(function(expr){
  11. expr = utils.unwrap(expr);
  12. if (!expr.nodes.length) return;
  13. console.log('\u001b[90minspect:\u001b[0m %s', expr.toString().replace(/^\(|\)$/g, ''));
  14. })
  15. return nodes.null;
  16. }).raw = true;