Skip to content

Commit fbd4024

Browse files
koba04mysticatea
authored andcommitted
Fix: Use ansi-style directly instead of chalk.styles (#108)
1 parent 59219e8 commit fbd4024

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

lib/create-header.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
// Requirements
1111
//------------------------------------------------------------------------------
1212

13-
const chalk = require("chalk")
13+
const ansiStyles = require("ansi-styles")
1414

1515
//------------------------------------------------------------------------------
1616
// Public Interface
@@ -38,7 +38,7 @@ module.exports = function createHeader(nameAndArgs, packageInfo, isTTY) {
3838
const packageVersion = packageInfo.body.version
3939
const scriptBody = packageInfo.body.scripts[name]
4040
const packagePath = packageInfo.path
41-
const color = isTTY ? chalk.styles.gray : { open: "", close: "" }
41+
const color = isTTY ? ansiStyles.gray : { open: "", close: "" }
4242

4343
return `
4444
${color.open}> ${packageName}@${packageVersion} ${name} ${packagePath}${color.close}

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
"codecov": "nyc report -r lcovonly && codecov"
3030
},
3131
"dependencies": {
32+
"ansi-styles": "^3.2.0",
3233
"chalk": "^2.1.0",
3334
"cross-spawn": "^5.1.0",
3435
"memory-streams": "^0.1.2",

0 commit comments

Comments
 (0)