Skip to content

Instantly share code, notes, and snippets.

@apaleslimghost
Last active January 4, 2017 22:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save apaleslimghost/884eb53543663796e6b7dd5f00df422c to your computer and use it in GitHub Desktop.
Save apaleslimghost/884eb53543663796e6b7dd5f00df422c to your computer and use it in GitHub Desktop.
#!/usr/bin/env node
const {maxSatisfying} = require('semver');
const fs = require('fs');
const path = require('path');
const versions = fs.readdirSync(path.resolve(process.env.NVM_DIR, 'versions', 'node'));
const range = process.argv[2];
console.log(maxSatisfying(versions, range) || '');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment