index.js 415 B

12345678910111213141516
  1. 'use strict';
  2. const pathKey = (options = {}) => {
  3. const environment = options.env || process.env;
  4. const platform = options.platform || process.platform;
  5. if (platform !== 'win32') {
  6. return 'PATH';
  7. }
  8. return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
  9. };
  10. module.exports = pathKey;
  11. // TODO: Remove this for the next major release
  12. module.exports.default = pathKey;