dir.js

  1. import consoleFunc from './internal/consoleFunc';
  2. /**
  3. * Logs the result of an [`async` function]{@link AsyncFunction} to the
  4. * `console` using `console.dir` to display the properties of the resulting object.
  5. * Only works in Node.js or in browsers that support `console.dir` and
  6. * `console.error` (such as FF and Chrome).
  7. * If multiple arguments are returned from the async function,
  8. * `console.dir` is called on each argument in order.
  9. *
  10. * @name dir
  11. * @static
  12. * @memberOf module:Utils
  13. * @method
  14. * @category Util
  15. * @param {AsyncFunction} function - The function you want to eventually apply
  16. * all arguments to.
  17. * @param {...*} arguments... - Any number of arguments to apply to the function.
  18. * @example
  19. *
  20. * // in a module
  21. * var hello = function(name, callback) {
  22. * setTimeout(function() {
  23. * callback(null, {hello: name});
  24. * }, 1000);
  25. * };
  26. *
  27. * // in the node repl
  28. * node> async.dir(hello, 'world');
  29. * {hello: 'world'}
  30. */
  31. export default consoleFunc('dir');