0.0.0 • Published 6 years ago

red-error v0.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

Red Error

Build Status npm version

Humble CLI command that print its arguments in red and exits with a non-zero code. Might be useful for showing more descriptive error messages when npm scripts fail.

Installation Options

Global

npm i -g red-error

npx

No install required, just run from any folder:

npx red-error I will exit with this message in red

Keep in mind that in order to use npx with Node.js < 8 you need to either install npx globally:

npm i -g npx

or update your version of npm:

npm i -g npm

Local

Install with npm / Yarn:

npm i -D red-error

Usage

Here's an example of one possible usage in an npm script for checking formatting with Prettier:

{
  "scripts": {
    "format": "prettier --write *.js",
    "format:check": "prettier --list-different *.js || red-error Code not formatted, use npm run format and try again",
  }
}

License

Red Error is MIT licensed. See LICENSE.