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.jsinstall 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
--outputor-oswitch, 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
--versionor-vflag will print the tool's name and current version.Help Message: Running TxtToHTML CLI tool with the
--helpor-hflag 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
.txtfile and convert it to.htmlfile and store it in./tildirectory.
node src/index.js document.txt
- The command which takes
.txtfiles inside the directory and convert it to.htmlfile and store it in./tildirectory.
node src/index.js document
- The command which take
.txtfile, convert it into.htmlfile and store in thecustomdirectory
node src/index.js document.txt -o custom
node src/index.js document.txt --output custom
- The command which take
.txtfile from thedocumentdirectory, convert it into.htmlfile and store in thecustomdirectory
node src/index.js document.txt -o custom
node src/index.js document.txt --output custom
- This command will search for all
.txtfiles in thedocumentdirectory and its subdirectories, convert them to.htmlfile, and recreate the same directory structure in thecustomdirectory with the corresponding.htmlfiles.
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)