Created
May 1, 2019 05:09
-
-
Save jsmrcaga/d037be9ba49d5193bab32e6f6f3438c6 to your computer and use it in GitHub Desktop.
A simple version reporter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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