npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

size-gen

v1.0.1

Published

A Node.js CLI utility to generate files of exact byte sizes efficiently via stream-chunked writing, perfect for testing, benchmarking, or disk space simulations.

Downloads

6

Readme

sizegen

NPM Version

Read this in other languages: 简体中文 | English


With streaming write technology, precisely generate files of a specified size.

Project Overview

sizegen is a command-line tool that uses streaming chunk writing to generate files of fixed sizes. It is ideal for disk testing, performance benchmarking, and generating sample data. The streaming method ensures that even large files can be generated efficiently while significantly reducing memory usage.

Key Features

  • Efficient Streaming Generation
    Generates large files efficiently using chunked writing, ensuring minimal memory usage.

  • Customizable Chunk Size
    Allows users to specify the size of the chunks used during writing based on their requirements.

Installation

Globally install sizegen using npm:

npm install -g size-gen

Alternatively, you can use other package managers for global installation:

pnpm:

pnpm add -g size-gen

yarn:

yarn global add size-gen

Note: Please ensure that Node.js is installed.

Usage

The basic command format for running sizegen is as follows:

sizegen <output> --size <size> [--chunk <chunk>]

Where:

  • <output>: The output file name (must include a file extension, e.g., data.bin).
  • --size <size>: Specifies the target file size with a unit (e.g., 10B, 512KB, 2MB, or 3.5GB).
  • --chunk <chunk>: (Optional) Specifies the chunk size used for writing, such as 16KB, 1MB, or 4MB. The default is 64KB.

Examples

  • Generate a 10MB file using the default chunk size:

    sizegen sample.bin --size 10MB
  • Generate a 2GB file using a 1MB chunk size:

    sizegen large.dat --size 2GB --chunk 1MB

Shortcuts

You can also use abbreviated options:

  • Use -s in place of --size
  • Use -c in place of --chunk

For example:

sizegen data.bin -s 10MB -c 64KB

Contributing and Feedback

We welcome contributions, bug reports, and feature suggestions! Before submitting an issue, please check the Issues page to see if similar feedback has already been provided.

License

This project is released under the MIT License.