Skip to content

Instantly share code, notes, and snippets.

@jsmrcaga
Created May 1, 2019 05:09
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 jsmrcaga/d037be9ba49d5193bab32e6f6f3438c6 to your computer and use it in GitHub Desktop.
Save jsmrcaga/d037be9ba49d5193bab32e6f6f3438c6 to your computer and use it in GitHub Desktop.
A simple version reporter
if (process.argv && process.argv.indexOf('-v') > -1) {
const { name, version } = require('./package.json');
return console.log(`${name} version ${version}`);
}
/*
Example:
node mystuff.js -v
> mystuff version 3.0.4
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment