DEV Community

Pavel Belokon
Pavel Belokon

Posted on

BukuRain, release 0.0.1

I spent one week creating my first CLI tool in JavaScript. To get started, I spend some time researching how to actually write one, as I had never had experience in creating CLI tools. In my initial attempt, I had a failure, but it served as a valuable learning experience. The next day, I approached the task with renewed confidence.

Currently, BukuRain features simple text-to-HTML conversion, output specification and automatic title setting for the page if there are two spaces after the line at the beginning of the document.

Usage

When you initially install BukuRain, you can run the command buku to see a cool ASCII Art logo and an example using "--help"

BukuRain accepts a file path for any text file and will generate an HTML file containing the text from the original file. You can use it like this:

buku --input ./file.txt

Each consecutive group of lines in the text file is considered a paragraph. If the file starts with a line separated by two spaces, it will be treated as a title and rendered as an <h1>...</h1> tag.

Additionally, BukuRain can process an entire directory of .txt files. You can use it as follows:

buku --input files/

Lastly, BukuRain allows users to specify an output directory where all HTML files will be stored. By default, it uses ./dist. You can customize the output directory using the following command:

buku --output files/ --input ./file.txt

That's all for this release of BukuRain. While it may not be the most advanced program for this task, I strongly believe it's a significant step forward for me.

Top comments (0)