index.js 321 B

12345678910111213
  1. 'use strict';
  2. const fs = require('fs');
  3. const os = require('os');
  4. const tempDirectorySymbol = Symbol.for('__RESOLVED_TEMP_DIRECTORY__');
  5. if (!global[tempDirectorySymbol]) {
  6. Object.defineProperty(global, tempDirectorySymbol, {
  7. value: fs.realpathSync(os.tmpdir())
  8. });
  9. }
  10. module.exports = global[tempDirectorySymbol];