file-plz v1.0.18
š File Please
A simple command-line tool to generate files of various types and specific sizes.
š Features
- š Create files of common types (e.g.,
.txt
,.zip
,.jpg
, etc.) - š Specify exact file size (e.g., 10KB, 5MB, 1GB, etc.)
- ā” Fast and lightweight utility
š Prerequisites
- Node.js v22.12 (LTS)
š§ Installation
Install globally using npm:
npm install file-plz -g
š Usage
Basic usage:
npx file-plz -t txt -s 10KB
Options:
| Option | Shorthan | Description | Example |
|----------------|----------------|-------------------------------------|-------------------|
| --size
| -s
| Size of the file (KB, MB, or GB) | 10KB
, 5MB
|
| --type
| -t
| File extension | jpg
, txt
|
| --debug
| -d
| Output debug info | - |
š¦ Examples
Create a 1MB text file
npx file-plz -t txt -s 1MB
Create a 500KB bitmap file
npx file-plz -t txt --size 500KB --t .bmp
Create a 1GB archive file
npx file-plz -t zip -size 1GB
š ļø How It Works
- File Generation: The program has a base set of instructions to create simple files, which are then merged with more complex file types to achieve the specific file size.
- File Content: The data within the files is random characters or generated noise.
ā ļø Challenges with File Size Accuracy
Achieving precise file sizes can be challenging, especially when working with compression and noise. For compressed file types (like .zip
), the final size depends on the compressibility of the file's contents. Random data is less compressible than repeating patterns, which can affect the actual size. Similarly, files with "noise" data may not be perfectly predictable in size, as different file systems and tools may handle binary data differently. This tool strives to get as close as possible to the requested size, but minor deviations may occur.
š Issues & Contributions
- Found a bug? Open an issue here.
- Want to contribute? Fork the repo, make changes, and submit a pull request.
š License
This project is licensed under the MIT License. See LICENSE for details.
ā If you find this tool useful, please give it a star!
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago
8 months ago