Skip to content

πŸ“‚ A simple command-line tool to generate files of various types and specific sizes.

License

Notifications You must be signed in to change notification settings

MikaelPorttila/file-plz

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ“‚ 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

  1. Create a 1MB text file

    npx file-plz -t txt -s 1MB
  2. Create a 500KB bitmap file

    npx file-plz -t txt --size 500KB --t .bmp
  3. 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!

About

πŸ“‚ A simple command-line tool to generate files of various types and specific sizes.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published