Comparing version 2.3.0 to 2.3.1
20
cli.js
@@ -7,4 +7,6 @@ #!/usr/bin/env node | ||
var info = require('./package.json'); | ||
var chalk = require('chalk'); | ||
var minimist = require('minimist'); | ||
var multiline = require('multiline'); | ||
var supportsColor = require('supports-color'); | ||
@@ -84,4 +86,5 @@ var args = minimist(process.argv.slice(2), { | ||
if (process.stdout.isTTY || args.force) { | ||
lolcatjs.options.colors = true; | ||
if (args.force) { | ||
chalk.enabled = true; | ||
chalk.level = supportsColor.supportsColor({isTTY: true}).level; | ||
} | ||
@@ -129,17 +132,10 @@ | ||
} else { | ||
var listenStdin = false; | ||
var promise = Promise.resolve(); | ||
args._.forEach(function(file) { | ||
if (file === '-') { | ||
listenStdin = true; | ||
promise = promise.then(() => lolcatjs.fromPipe()); | ||
} else { | ||
lolcatjs.fromFile(file); | ||
promise = promise.then(() => lolcatjs.fromFile(file)); | ||
} | ||
}); | ||
if (listenStdin) { | ||
lolcatjs.fromPipe(); | ||
} | ||
} | ||
@@ -146,0 +142,0 @@ } |
@@ -30,4 +30,2 @@ "use strict"; | ||
freq: 0.3, | ||
// To use colors for the output or not. | ||
colors: false | ||
}; | ||
@@ -112,2 +110,3 @@ | ||
}); | ||
return new Promise(resolve => process.stdin.on('end', resolve)); | ||
}; | ||
@@ -123,2 +122,3 @@ | ||
}); | ||
return new Promise(resolve => fileReader.on('end', resolve)); | ||
}; | ||
@@ -125,0 +125,0 @@ |
{ | ||
"name": "lolcatjs", | ||
"version": "2.3.0", | ||
"version": "2.3.1", | ||
"description": "The rainbow I tastes it", | ||
@@ -37,3 +37,4 @@ "main": "index.js", | ||
"minimist": "^1.1.1", | ||
"multiline": "^1.0.2" | ||
"multiline": "^1.0.2", | ||
"supports-color": "^5.0.0" | ||
}, | ||
@@ -40,0 +41,0 @@ "optionalDependencies": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9560
7
+ Addedsupports-color@^5.0.0