@kawu/console-kit v11.0.5
Console-kit
A fast, light weight, minimalist and reliable module to log stuff easly and more understable.
Installation
Use this command to add Console-kit
npm i @kawu/console-kitUsage
TS
import { ConsoleKit } from "@kawu/console-kit";
const consoleKit = new ConsoleKit();JS
const { ConsoleKit } = require("@kawu/console-kit");
const consoleKit = new ConsoleKit();Logging
When logging what's going on in your application is crucial, I have dedicated functions for every situation.


Comments
consoleKit.comment(CommentOptions);// CommentOptions
message: string;
timestamp: boolean; // Not requiredSuccess
consoleKit.success(CheckOptions);// CheckOptions
message: string;
timestamp: boolean; // Not requiredInfo
consoleKit.info(InfoOptions);// InfoOptions
message: string;
timestamp: boolean; // Not requiredWarn
consoleKit.warn(WarnOptions);// WarnOptions
message: string;
timestamp: boolean; // Not requiredError
consoleKit.error(ErrorOptions);// ErrorOptions
message: string;
timestamp: boolean; // Not requiredLoading
This is kinda usefull to tell that your terminal is doing background stuff.

Start loader
consoleKit.startLoading(StartLoaderOptions);// StartLoaderOptions
message: string;
timestamp: boolean; // Not requiredStop loader
consoleKit.stopLoading(StopLoaderOptions);// StopLoaderOptions
clearLine: boolean; // Remove the loading line if trueProgress Bar
Like the loading but we know when the loading will finish.

Start progress bar
consoleKit.startProgress(StartProgressOptions);// StartProgressOptions
message: string;
percentage: number;
timestamp: boolean; // Not requiredEdit the actual progress bar
consoleKit.editProgress(EditProgressOptions);// EditProgressOptions
percentage: number;
message: string;End progress bar
consoleKit.endProgress(EndProgressOptions);// EndProgressOptions
clearLine: boolean; // Remove the progress bar line if truePrompt
If your user need to give you data, then the prompt is a good way to go.

Usage
consoleKit.prompt(PromptOptions);// PromptOptions
message: string;
character: string; // Not required -- If you wish to replace "?", put your own icon hereOutput
string;YesNo
It's like prompt but for boolean values.

Usage
consoleKit.yesno(YesNoOptions);// YesNoOptions
message: string;
defaultValue: boolean; // true = yes | false = noOutput
If the default value is false and the user send for example lol then the output will be false because he didn't put no/n or yes/y.
boolean;Select
You have a list and your user have to select an item inside a list, then this will do the job.

consoleKit.select(SelectOptions);values: Array<string>;
defaultValueIndex: number; // Not required -- Index number of the values array
selectedText: string; // Not required -- Custom the "[ • ]" (Item selected)
unselectedText: string; // Not required -- Custom the "[ ]" (Item not selected)
cleanafter: boolean; // Not required -- Remove the selection of the terminal when user finished1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
1 year ago
1 year ago
2 years ago
1 year ago
1 year ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago