# fileinator

> A simple utility to generate files with a specified size and random content.

Latest version **4.0.0** (published 2025-10-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install fileinator
pnpm add fileinator
yarn add fileinator
bun add fileinator
```

Provides the command `fileinator`.

## Health

**Score 65/100 (B)** — status: stable.

Positive: has types; esm support; no vulnerabilities; has provenance; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2025-10-15 |
| First published | 2016-03-14 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 3 |
| Unpacked size | 13.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Provenance | attested (GitHub Actions) |
| Author | Justin Beckwith |
| Maintainers | justinbeckwith |

## Links

- npm: https://www.npmjs.com/package/fileinator
- Repository: https://github.com/JustinBeckwith/fileinator
- Homepage: https://github.com/JustinBeckwith/fileinator#readme
- Issues: https://github.com/JustinBeckwith/fileinator/issues
- npm.io page: https://npm.io/package/fileinator

## Dependencies (3)

- [yargs](https://npm.io/package/yargs.md) ^18.0.0
- [progress](https://npm.io/package/progress.md) ^2.0.3
- [filesize-parser](https://npm.io/package/filesize-parser.md) ^1.5.0

## Recent versions

- 4.0.0 (latest) — 2025-10-15
- 3.0.1 — 2025-09-08
- 3.0.0 — 2024-10-28
- 2.0.2 — 2022-05-04
- 2.0.1 — 2021-01-10
- 2.0.0 — 2020-06-11
- 1.1.0 — 2020-05-11
- 1.0.2 — 2020-05-11
- 1.0.1 — 2019-12-15
- 1.0.0 — 2019-06-29
- 0.0.9 — 2019-02-12
- 0.0.8 — 2019-01-20
- 0.0.7 — 2019-01-20
- 0.0.6 — 2018-04-19
- 0.0.5 — 2016-03-20
- … 4 more at https://npm.io/package/fileinator/versions

## README

# fileinator

[![npm version](https://img.shields.io/npm/v/fileinator.svg)](https://www.npmjs.org/package/fileinator)
[![codecov](https://codecov.io/gh/JustinBeckwith/fileinator/branch/main/graph/badge.svg)](https://codecov.io/gh/JustinBeckwith/fileinator)
[![code style: biome](https://img.shields.io/badge/code_style-biome-60a5fa?logo=biome)](https://biomejs.dev/)

![fileinator](https://raw.githubusercontent.com/JustinBeckwith/fileinator/main/site/fileinator.webp)

> Behold my latest inator! Generate files full of random bytes.  Good for tests.

## Installation

`npm install -g fileinator`

## Usage

You can use the fileinator as a command line tool or as a library.  To use as a command line tool:

`fileinator make 10gb ./bigfile`

To use as a library, first install locally:
`npm install --save fileinator`

and then enjoy...

```js
const fileinator = require('../lib/fileinator');
const sizeParser = require('filesize-parser');

const size = sizeParser("20mb");
const path = "./data.dat";

fileinator.writeFile(size, path)
  .on('progress', (data) => {
    console.log(`${data.bytesWritten} of ${size} written`);
  }).on('done', () => {
    console.log(`Complete: ${path}`);
  });
```

See more in the [examples](examples/).

## License

[MIT License](LICENSE.md)

## Questions?

Feel free to submit an issue on the repository!

---
_Source: https://npm.io/package/fileinator · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
