bin/cli.js
function outputVersion () {
  fs.readFile(path.join(__dirname, '/../package.json'), function (err, data) {
    if (err) {
      console.log(err.toString())
    } else {
      const pkg = JSON.parse(data)
      const version = pkg && pkg.version ? pkg.version : 'unknown'
      console.log(version)
    }
    process.exit(0)
  })
}
function outputVersion () {
  fs.readFile(path.join(__dirname, '/../package.json'), function (err, data) {
    if (err) {
      console.log(err.toString())
    } else {
      const pkg = JSON.parse(data)
      const version = pkg && pkg.version ? pkg.version : 'unknown'
      console.log(version)
    }
    process.exit(0)
  })
}
function outputVersion ( ) { fs . readFile ( path . join ( __dirname , '/../package.json' ) , function ( err , data ) { if ( err ) { console . log ( err . toString ( ) ) } else { const pkg = JSON . parse ( data ) const version = pkg && pkg . version ? pkg . version : 'unknown' console . log ( version ) } process . exit ( 0 ) } ) }
Output application version number.
Version number is read version from package.json.
Output application version number . Version number is read version from package . json .