fileinator
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

fileinator

npm version codecov semantic-release

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

inator

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...

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.

License

MIT License

Questions?

Feel free to submit an issue on the repository!

Readme

Keywords

none

Package Sidebar

Install

npm i fileinator

Weekly Downloads

1

Version

3.0.0

License

MIT

Unpacked Size

9.37 kB

Total Files

11

Last publish

Collaborators

  • justinbeckwith