index.js 386 B

1234567891011121314
  1. function isNodeLT(tar) {
  2. tar = (Array.isArray(tar) ? tar : tar.split('.')).map(Number);
  3. let i=0, src=process.versions.node.split('.').map(Number);
  4. for (; i < tar.length; i++) {
  5. if (src[i] > tar[i]) return false;
  6. if (tar[i] > src[i]) return true;
  7. }
  8. return false;
  9. }
  10. module.exports =
  11. isNodeLT('8.6.0')
  12. ? require('./dist/index.js')
  13. : require('./lib/index.js');