@interaktiv/mibuilder-colors

1.0.0 • Public • Published

@interaktiv/mibuilder-colors

Standard colors for MiBuilder CLI

Commitizen friendly Conventional Commits Semantic Release Code of Conduct MIT License

npm latest version npm next version

This Solution

Standard colors for MiBuilder CLI.

Using color is encouraged in commands to help the user quickly read command output. Some nouns in the CLI such as apps and config vars have standard colors that should be used when possible.

Table of Contents

Installation

This module can be installed via npm which is bundled with Node.js and should be installed as one of your project's dependencies:

npm install --save @interaktiv/mibuilder-colors

Usage

import { color } from '@interaktiv/mibuilder-colors';

this.log(`this is an app: ${color.app(myapp.name)}`);
this.log(`this is a config var: ${color.configVar(myapp.name)}`);

When a standard color isn’t available, color can be used to show other colors as well:

import { color } from '@interaktiv/mibuilder-colors';

this.log(`this is an other color: ${color.green(result.message)}`);

Suggested colors are magenta, cyan, blue, green, and gray. Don’t forget that .dim and .bright, .underline, and background colors can also be used to provide more variety in color use.

Be mindful with color. Too many contrasting colors in the same place can quickly begin to compete for the user’s attention. Using just a couple of colors and maybe dim/bolding existing ones can often provide enough contrast.

Yellow and red may also be used, but note that these typically are saved for errors and warning messages.

References

Other Use Cases

If you lack some use cases, you are welcome to open a pull request and add it. We'll come back to you and see how we can support your use case and present it to all devs.

Please consult the contribution guides before contributing.

Acknowledgements

This library is heavily inspired by @heroku-cli/color. Thank you 💙

License

MIT Copyright © 2020-present die.interaktiven GmbH & Co. KG

Package Sidebar

Install

npm i @interaktiv/mibuilder-colors

Weekly Downloads

3

Version

1.0.0

License

LICENSE SEE IN LICENSE

Unpacked Size

11 kB

Total Files

6

Last publish

Collaborators

  • kbshl
  • dia-bot