<commit_before>{ path, Promise } = fs = require 'nofs'
npm = require './npm'

isWin = process.platform is 'win32'
warnSign = if isWin then ' * Warning: ' else '⚠  '
errorSign = if isWin then ' ERROR: ' else '✖  '
okSign = if isWin then ' ^_^Y  ' else '✔  '

cwdFilePath = (names...) ->
    path.join.apply path, [process.cwd()].concat names

logInfo = (str) ->
    console.log '\n>>  '.yellow + str.green
logSucc = (str) ->
    console.log "\n#{okSign}#{str}".green

module.exports = {
    cwdFilePath
    errorSign
    warnSign
    okSign
    logSucc

    readPackageFile: (name) ->
        filePath = if name then cwdFilePath('node_modules', name, 'package.json') else cwdFilePath 'package.json'
        fs.readJSONSync filePath

    print: (deps, showWarn = true) ->
        deps.map (dep) ->
            dep.needUpdate and console.log "[#{dep.type}]".green, _.padRight(dep.packageName.cyan, 40),
                _.padLeft(dep.baseVer.toString(), 8).green, '->', dep.newVer.toString().red
            showWarn and dep.warnMsg and console.log warnSign.yellow + "#{dep.warnMsg}".white

    logInfo

    install: (packages) -><commit_msg>opt: windows fall back for signs<commit_after>{ path, Promise } = fs = require 'nofs'
npm = require './npm'

isWin = process.platform is 'win32'
warnSign = if isWin then '‼ ' else '⚠  '
errorSign = if isWin then '× ' else '✖  '
okSign = if isWin then '√  ' else '✔  '
infoSign = if isWin then 'i ' else 'ℹ '

cwdFilePath = (names...) ->
    path.join.apply path, [process.cwd()].concat names

logInfo = (str) ->
    console.log '\n>> '.yellow + str.green
logSucc = (str) ->
    console.log "\n#{okSign}#{str}".green

module.exports = {
    cwdFilePath
    errorSign
    warnSign
    okSign
    logSucc

    readPackageFile: (name) ->
        filePath = if name then cwdFilePath('node_modules', name, 'package.json') else cwdFilePath 'package.json'
        fs.readJSONSync filePath

    print: (deps, showWarn = true) ->
        deps.map (dep) ->
            dep.needUpdate and console.log "[#{dep.type}]".green, _.padRight(dep.packageName.cyan, 40),
                _.padLeft(dep.baseVer.toString(), 8).green, '->', dep.newVer.toString().red
            showWarn and dep.warnMsg and console.log warnSign.yellow + "#{dep.warnMsg}".white

    logInfo

    install: (packages) ->
{'fraction_non_alphanumeric': 0.15557476231633535, 'fraction_numerical': 0.00432152117545376, 'mean_word_length': 2.7520259319286873, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 23, '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': '1950821', 'n_tokens_mistral': 802, 'n_tokens_neox': 791, 'n_words': 202}