Hello Everyone!
We're thrilled to present you to the TxtToHTML Command Line Tool, an effective tool built to quickly convert an entire directories of .txt
files and individual .txt
files into .html
format. This ground-breaking project makes use of Node.js
, a flexible open-source runtime environment for JavaScript
code. This is particularly noteworthy since it is our first attempt at creating a command line utility.
Getting Started: Installation Guide
TxtToHTML makes it simple to start your adventure. Here is how to configure the tool on your computer:
- To clone this repository use the command given below:
git clone https://github.com/bhavik001/TxtToHTML.git
cd TxtToHTML
- Make sure you have
Node.js
install in you device. Check it using this command:
node -v
if not download the Node.js
locally to your device.
- Run the following command in the terminal to download the dependencies:
npm install
- Now to run the code write the following command in the terminal:
npm run start
Features
Recursive Search for .txt Files: When a user inputs a folder, TxtToHTML CLI tool will recursively scan that folder for.txt files and recreate the directory structure in the output directory.
Custom Output Directory: By using the
--output
or-o
switch, users can select an alternative output directory. The default output directory is "til" if not otherwise specified. If the directory is empty, TxtToHTML CLI tool creates it.Version Information: Running TxtToHTML CLI tool with the
--version
or-v
flag will print the tool's name and current version.Help Message: Running TxtToHTML CLI tool with the
--help
or-h
flag will display a standard help/usage message, explaining how to use the tool, available command-line flags, and arguments.Input Flexibility: A single.txt file or a folder containing.txt files can be specified as input by users of the TxtToHTML CLI tool. The programme processes a.txt file if one is given. It processes all.txt files contained in any specified directory if one is provided.
HTML Output Generation: For each input file, the TxtToHTML CLI tool creates a single.html file. For instance, using the tool to build a new 'bhavik.html' file from a 'bhavik.txt' file. The HTML5 standard is followed by the files that are created.
How to use this tool
- The basic command is:
node src/index.js [options] <input>
- The command to display help menu:
node src/index.js -h
node src/index.js --help
- The command to display the version of the TxtToHTML CLI Tool:
node src/index.js -v
node src/index.js --version
- The command which takes
.txt
file and convert it to.html
file and store it in./til
directory.
node src/index.js document.txt
- The command which takes
.txt
files inside the directory and convert it to.html
file and store it in./til
directory.
node src/index.js document
- The command which take
.txt
file, convert it into.html
file and store in thecustom
directory
node src/index.js document.txt -o custom
node src/index.js document.txt --output custom
- The command which take
.txt
file from thedocument
directory, convert it into.html
file and store in thecustom
directory
node src/index.js document.txt -o custom
node src/index.js document.txt --output custom
- This command will search for all
.txt
files in thedocument
directory and its subdirectories, convert them to.html
file, and recreate the same directory structure in thecustom
directory with the corresponding.html
files.
node src/index.js -o custom document
node src/index.js --output custom document
License
TxtToHTML CLI Tool operates under the MIT license, granting you the freedom to use and modify it as needed.
Welcome to a new era of effortless text-to-HTML conversion with TxtToHTML CLI Tool!
Top comments (0)