Skip to content

okwolf/red-error

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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. Compatible with Node.js >= 4.

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.

About

Exit with non-zero code and red error message

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published