The @kwaeri/console component for the @kwaeri/node-kit application platform
- The Implementation
- Getting Started
- How to Contribute Code
- Other Ways to Contribute
The @kwaeri/console component offers an eloquent API featuring methods for setting background color, foreground color, and text effects. Additional methods offer a means to buffer portions of text, to manipulate the styles of each portion, and to dump the result as a collective whole.
The following sections cover how to get started with @kwaeri/console. For a more formal experience, browse the online documentation.
Start off by installing the module in your project:
npm install @kwaeri/console
To leverage the console module, you'll first need to include it:
Follow up by creating an instance of the Console object:
// DEFINESlet output = color: false background: false decor: ;
Now you're ready to start formatting text.
To set the color of any subsequently buffered text, use the color method:
outputcolor 'blue' ;
The following colors are available to choose from:
To set the background color of any subsequently buffered text, use the background method:
outputbackground 'black' ;
The following background colors are available to choose from:
To apply a variety of text decorations to any subsequently buffered text, use the decor method:
The following text decorations are available to choose from:
- blink (Probably isn't going to work for you...)
When you want to reset the state of the styling, use the normalize method:
This will clear the background and foreground colors, as well as clear and text decorations.
When you want to clear any buffered text, use the clear method:
The clear method clears the stack of buffered text.
When you want to buffer portions of styled text, use the buffer method:
Each call to buffer adds a layer to the stack.
When you want to combine the portions of text which have been buffered, use the dump method:
Each layer of the stack is joined to form a string. Once the stack has been dumped, it has also been cleared, so you are left with a fresh slate.
Keep in mind, however, that the styling does not normalize from a call to
Putting it Together
Here's an example where we put it all together to create a colorful message for the console:
// INCLUDES;// DEFINESlet output = color: false background: false decor: ;// Here we create an error message for a module that takes command line arguments:let errorMessage = outputcolor 'red'color 'blue';console;// The output object is normalized if you couldn't tell, so we have a fresh slate// to continue with...
How to Contribute Code
Our Open Source projects are always open to contribution. If you'd like to cocntribute, all we ask is that you follow the guidelines for contributions, which can be found at the Massively Modified Wiki
Other Ways to Contribute
There are other ways to contribute to the project other than with code. Consider testing the software, or in case you've found an Bug - please report it. You can also support the project monetarly through donations via PayPal.
Regardless of how you'd like to contribute, you can also find in-depth information for how to do so at the Massively Modified Wiki
To submit bug reports, request enhancements, and/or new features - please make use of the issues system baked-in to our source control project space at Gitlab
You may optionally start an issue, track, and manage it via email by sending an email to our project's support desk.
For more in-depth documentation on the process of submitting bug reports, please visit the Massively Modified Wiki on Bug Reports
Our Vulnerability Reporting process is very similar to Gitlab's. In fact, you could say its a fork.
To submit vulnerability reports, please email our Security Group. We will try to acknowledge receipt of said vulnerability by the next business day, and to also provide regular updates about our progress. If you are curious about the status of your report feel free to email us again. If you wish to encrypt your disclosure email, like with gitlab - please email us to ask for our GPG Key.
Please refrain from requesting compensation for reporting vulnerabilities. We will publicly acknowledge your responsible disclosure, if you request us to do so. We will also try to make the confidential issue public after the vulnerability is announced.
You are not allowed, and will not be able, to search for vulnerabilities on Gitlab.com. As our software is open source, you may download a copy of the source and test against that.
When a vulnerability is discovered, we create a [confidential issue] to track it internally. Security patches will be pushed to private branches and eventually merged into a
security branch. Security issues that are not vulnerabilites can be seen on our public issue tracker.
For more in-depth information regarding vulnerability reports, confidentiality, and our practices; Please visit the Massively Modified Wiki on Vulnerability
If you cannot contribute time or energy to neither the code base, documentation, nor community support; please consider making a monetary contribution which is extremely useful for maintaining the Massively Modified network and all the goodies offered free to the public.