env.js 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  1. /**
  2. * Data about the environment in which JSDoc is running, including the configuration settings that
  3. * were used to run JSDoc.
  4. *
  5. * @module jsdoc/env
  6. */
  7. module.exports = {
  8. /**
  9. * The times at which JSDoc started and finished.
  10. *
  11. * @type {Object}
  12. * @property {Date} start - The time at which JSDoc started running.
  13. * @property {Date} finish - The time at which JSDoc finished running.
  14. */
  15. run: {
  16. start: new Date(),
  17. finish: null
  18. },
  19. /**
  20. * The command-line arguments passed to JSDoc.
  21. *
  22. * @type {Array<*>}
  23. */
  24. args: [],
  25. /**
  26. * The data parsed from JSDoc's configuration file.
  27. *
  28. * @type Object<string, *>
  29. */
  30. conf: {},
  31. /**
  32. * The absolute path to the base directory in which JSDoc is located. Set at startup.
  33. *
  34. * @private
  35. * @type {string}
  36. */
  37. dirname: null,
  38. /**
  39. * The user's working directory at the time when JSDoc started running.
  40. *
  41. * @private
  42. * @type {string}
  43. */
  44. pwd: null,
  45. /**
  46. * The command-line arguments, parsed into a key/value hash.
  47. *
  48. * @type {Object}
  49. * @example if (global.env.opts.help) { console.log('Helpful message.'); }
  50. */
  51. opts: {},
  52. /**
  53. * The source files that JSDoc will parse.
  54. *
  55. * @type {Array<string>}
  56. * @memberof env
  57. */
  58. sourceFiles: [],
  59. /**
  60. * The JSDoc version number and revision date.
  61. *
  62. * @type {Object<string, string>}
  63. * @property {string} number - The JSDoc version number.
  64. * @property {string} revision - The JSDoc revision number, expressed as a UTC date string.
  65. */
  66. version: {
  67. number: null,
  68. revision: null
  69. }
  70. };