Socket
Socket
Sign inDemoInstall

fileinator

Package Overview
Dependencies
18
Maintainers
1
Versions
16
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    fileinator

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


Version published
Weekly downloads
18
increased by12.5%
Maintainers
1
Install size
649 kB
Created
Weekly downloads
 

Readme

Source

fileinator

npm version Build Status 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, or find me at @JustinBeckwith

FAQs

Last updated on 04 May 2022

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc