index.js 433 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. var os = require('os');
  3. var nameMap = {
  4. '15': 'El Capitan',
  5. '14': 'Yosemite',
  6. '13': 'Mavericks',
  7. '12': 'Mountain Lion',
  8. '11': 'Lion',
  9. '10': 'Snow Leopard',
  10. '9': 'Leopard',
  11. '8': 'Tiger',
  12. '7': 'Panther',
  13. '6': 'Jaguar',
  14. '5': 'Puma'
  15. };
  16. module.exports = function (release) {
  17. release = (release || os.release()).split('.')[0];
  18. return {
  19. name: nameMap[release],
  20. version: '10.' + (Number(release) - 4)
  21. };
  22. };