Table Of Contents
This is a Node.Js package that I wrote to easily create a CLI. It handles things like progress bars, colored messages, program input parameters, and user input.
The name of the package on NPM is dscom which stands for Divine Star Commander.
I made this because I plan to make several NodeJS CLI tools and wanted a simple effective way to do so.
Full List Of Technology Used
- The whole library is written in TypeScript.
- Used to host and install the package.
I designed dscom to be very simple and elegant. It has many features but it all servers the same purpose.
When you use dscom you will use a single object that you use to chain together commands. Basically all of the functions can be chained together because it returns the parent object (the instance of dscom).
Here is an example:
dsCom.newScreen() .BLINK.showSleep("BLINK") .INFO.showSleep("Some Info.") .GOOD.showSleep("Everything is fine.") .ERROR.showSleep("Everything is not fine.") .WARNING.showSleep("Something may be wrong.")
Before each message there is an all caps variable that is accessed. I call these "directives". What they do is alter the output of the following messages.
You can use pre-defined messages like shown above or you can create custom colored messages.
I was inspired by the NPM library chalk which is used just to create color messages for the console. It also uses chaining to create styled console messages.