Install scripts for colored output
npx maki-color install ./path/to/scripts
This installs the following scripts at path/to/scripts
:
color.js
color.sh
- Mac OS
- Node >= 8
- NPM >= 5.3
Shell scripts:
#!/bin/bash
# test.sh
source ./path/to/scripts/color.sh
color_init
color "${BLUE}Script is processing"
color "${YELLOW}Be careful of user input!"
color "${RED}Error!"
color "${GREEN}Script completed successfully."
JS scripts:
// test.js
const { color, colorInit } = require('./path/to/scripts/color.js'):
colorInit();
color`{BLUE}Script is processing`;
color`{YELLOW}Be careful of user input!`;
color`{RED}Error!`;
color`{GREEN}Script completed successfully.`;
Set the $COLOR_ORIGIN
environment variable to turn off the file origin trace:
export COLOR_ORIGIN=false