COMPRESSO is a command-line application that compresses and decompresses text-based files using an efficient variable length huffman encoding algorithm. It reduces file sizes while preserving content integrity.
- Supports compression and decompression of text-based files (
.txt
,.md
,.json
,.js
,.py
,.csv
,.html
,.yml
, etc.) - Uses Huffman Encoding for optimized compression
- Command-line interface for easy usage
- Preserves original file structure
- Fast and lightweight
Ensure you have Node.js installed, then clone the repository:
# Clone the repository
git clone https://github.com/ShawonECE/compresso.git
cd compresso
To compress a text file, keep the file inside data/input/
and run:
npm run compress -- inputFileName.extension compressedFileName
Example:
npm run compress -- input.txt compressed
This will create a compressed .bin file in data/compressed/
as compressed.bin
.
To decompress a compressed file, keep the compressed file inside data/compressed/
and run:
npm run decompress -- compressedFileName outputFileName
Example:
npm run decompress -- compressed my_output
This will restore the file to data/output/
and the file name will be my_output.extension
.
text-compression-tool/
│── data/
│ ├── compressed/ # Stores compressed files
│ ├── input/ # Stores input text files
│ ├── output/ # Stores decompressed text files
│── src/
│ ├── modules/
│ │ ├── fileUtils/
| │ │ ├── readFile.js
| │ │ ├── writeFile.js
│ │ ├── text/
| │ │ ├── text-compression/
| | │ │ ├── compressor.js
| | │ │ ├── fileNameHandler.js
| | │ │ ├── huffmanEncoder.js
| | │ │ ├── huffmanTree.js
| | │ │ ├── structures.js
| │ │ ├── text-decompression/
| | │ │ ├── huffmanDecoder.js
| | │ │ ├── decompressor.js
| | │ │ ├── metadata.js
| ├── compress.js
│ ├── decompress.js
│── package.json
│── README.md
- Compression: Reads the input file, builds a Huffman tree, and encodes the data efficiently.
- Decompression: Reads the compressed file, reconstructs the Huffman tree, and restores the original text.
- Node.js
v16+
Pull requests are welcome! Feel free to open an issue if you find a bug or have suggestions.
For any inquiries, contact: [email protected]