# rnd-file

> Generation of a random files with Node.JS.

Latest version **0.0.1** (published 2023-09-07) · MIT license · 0 weekly downloads

## Install

```sh
npm install rnd-file
pnpm add rnd-file
yarn add rnd-file
bun add rnd-file
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.1 |
| Published | 2023-09-07 |
| First published | 2023-09-07 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 10.3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 1 |
| Author | RomanBurunkov |
| Maintainers | romon2002 |
| Keywords | generate, random, files |

## Links

- npm: https://www.npmjs.com/package/rnd-file
- Repository: https://github.com/RomanBurunkov/node-rnd-file
- Homepage: https://github.com/RomanBurunkov/node-rnd-file#readme
- Issues: https://github.com/RomanBurunkov/node-rnd-file/issues
- npm.io page: https://npm.io/package/rnd-file

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 0.0.1 (latest) — 2023-09-07

## README

# node-rnd-file

[![npm](https://img.shields.io/npm/v/rnd-file.svg)](https://www.npmjs.org/package/rnd-file)
[![codecov](https://codecov.io/gh/RomanBurunkov/tm-is/branch/main/graph/badge.svg?token=64HIR1FX0Z)](https://codecov.io/gh/RomanBurunkov/tm-is)

Generation of a random files with Node.JS.

This module uses fs write streams, so in addition to file's name and path,
you can specify each data chunk size, which will be passed into a stream.
Default chunk size: 1 KB.

## Installation

`npm i rnd-file`

## Available options

Option name | Description | Default
--- | --- | ---
fileName | File name as a String| 'random.file'
filePath | Path to a file as a String| os.tmpdir()
fileSize | File size in bytes as a Number | 1024
chunkSize | Chunk size in bytes as a Number | 1024
hashAlgo | Algorithm name to generate file's hash as a String | 'md5'


## Usage Example:
```javascript
const rndFile = require('rnd-file');

// Generates random 4KB file /tmp/myfile.
async function generateRandomFile() {
  const file = await rndFile({
    filePath: '/tmp',
    fileName: 'myfile',
    fileSize: 4096,
    chunkSize: 1024,
  });

  console.log('Generated file:', file);
}

generateRandomFile();

```

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