utils.js 605 B

12345678910111213141516171819202122232425262728293031
  1. /**
  2. * Copyright(c) node-modules and other contributors.
  3. * MIT Licensed
  4. *
  5. * Authors:
  6. * fengmk2 <m@fengmk2.com> (http://fengmk2.com)
  7. */
  8. 'use strict';
  9. /**
  10. * Module dependencies.
  11. */
  12. var util = require('util');
  13. var debug;
  14. var node10 = process.version.indexOf('v0.10.') === 0;
  15. if (node10) {
  16. debug = function () {
  17. if (process.env.NODE_DEBUG && /agentkeepalive/.test(process.env.NODE_DEBUG)) {
  18. console.log.apply(console.log, arguments);
  19. }
  20. };
  21. } else {
  22. debug = util.debuglog('agentkeepalive');
  23. }
  24. exports.debug = debug;
  25. exports.isNode10 = node10;
  26. exports.inherits = util.inherits;