<commit_before>#!/usr/bin/env node
'use strict'

var npmLateset = require('./../lib/npm-latest')
var path = require('path')
var fs = require('fs')
var colors = require('colors')
var vcsurl = require('vcsurl')

function main () {
  if (process.argv.length < 3) {
    displayHelp()
  } else {
    process.argv.slice(2).forEach(function (packageName) {
      npmLateset(packageName, function (err, result) {
        if (err) {
          if (err.error === 'not_found') {
            console.log('')
            console.log("  Package '%s' not found in NPM.", colors.blue(packageName))
            console.log('')
          } else {
            console.log('ERROR')
            console.log(err.reason)
          }
          return
        }

        console.log('')
        console.log('  ' + colors.blue(packageName + ': '))
        console.log('    latest: ' + result.version)
        console.log('    last updated: ' + result.time)
        if (result.author && result.author.name) {
          console.log('    author: ' + result.author.name)
        }
        if (result.repository && result.repository.url) {
          console.log('    repo: ' + vcsurl(result.repository.url))
        }
        if (result.description) {
          console.log('    description: ' + result.description)
        }
        console.log('')

      })
    })
  }
}

function displayHelp () {
  var packageJson = path.join(__dirname, '../package.json')
  if (fs.existsSync(packageJson)) {
    var packageConf = JSON.parse(fs.readFileSync(packageJson).toString())
    console.log('')
    console.log(colors.bold('  npm-latest [%s]'), packageConf.version)
    console.log('')
    console.log('    Usage: npm-latest [package]')
    console.log('')

  } else {
    console.log("Can't locate package.json. Can't display help.")
  }
}

main()
<commit_msg>bin/cli: standard tidy<commit_after>#!/usr/bin/env node
'use strict'

var npmLateset = require('./../lib/npm-latest')
var path = require('path')
var fs = require('fs')
var colors = require('colors')
var vcsurl = require('vcsurl')

function main () {
  if (process.argv.length < 3) {
    displayHelp()
  } else {
    process.argv.slice(2).forEach(function (packageName) {
      npmLateset(packageName, function (err, result) {
        if (err) {
          if (err.error === 'not_found') {
            console.log('')
            console.log("  Package '%s' not found in NPM.", colors.blue(packageName))
            console.log('')
          } else {
            console.log('ERROR')
            console.log(err.reason)
          }
          return
        }

        console.log('')
        console.log('  ' + colors.blue(packageName + ': '))
        console.log('    latest: ' + result.version)
        console.log('    last updated: ' + result.time)
        if (result.author && result.author.name) {
          console.log('    author: ' + result.author.name)
        }
        if (result.repository && result.repository.url) {
          console.log('    repo: ' + vcsurl(result.repository.url))
        }
        if (result.description) {
          console.log('    description: ' + result.description)
        }
        console.log('')
      })
    })
  }
}

function displayHelp () {
  var packageJson = path.join(__dirname, '../package.json')
  if (fs.existsSync(packageJson)) {
    var packageConf = JSON.parse(fs.readFileSync(packageJson).toString())
    console.log('')
    console.log(colors.bold('  npm-latest [%s]'), packageConf.version)
    console.log('')
    console.log('    Usage: npm-latest [package]')
    console.log('')
  } else {
    console.log("Can't locate package.json. Can't display help.")
  }
}

main()

{'fraction_non_alphanumeric': 0.16361149110807113, 'fraction_numerical': 0.001094391244870041, 'mean_word_length': 2.246891651865009, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5538662', 'n_tokens_mistral': 1147, 'n_tokens_neox': 1119, 'n_words': 220}