Skip to content

Commit

Permalink
Fix: Use ansi-style directly instead of chalk.styles (#108)
Browse files Browse the repository at this point in the history
  • Loading branch information
koba04 authored and mysticatea committed Aug 28, 2017
1 parent 59219e8 commit fbd4024
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/create-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
// Requirements
//------------------------------------------------------------------------------

const chalk = require("chalk")
const ansiStyles = require("ansi-styles")

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

return `
${color.open}> ${packageName}@${packageVersion} ${name} ${packagePath}${color.close}
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"codecov": "nyc report -r lcovonly && codecov"
},
"dependencies": {
"ansi-styles": "^3.2.0",
"chalk": "^2.1.0",
"cross-spawn": "^5.1.0",
"memory-streams": "^0.1.2",
Expand Down

1 comment on commit fbd4024

@yaman9900
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/create-header.js

Please sign in to comment.