dfgen

0.5.7 • Public • Published

dfgen

dfgen is a NodeJS command line interface that creates dummy files for testing purpose.

Installation

# local
npm install --save-dev dfgen

# global
npm install --global dfgen

Usage

# local
npx dfgen --help

# global
dfgen --help

Generate a blank pdf file

dfgen --type pdf 

Generate a pdf file with custom text

dfgen --type pdf --text-content "This is a text content"

Generate an image with custom text

dfgen --type png --text-content "This is a text inside a png"

dfgen --type jpg --width-height "500/200" --text-content "This is a text inside a 500px * 200px jpg "

Generate a corrupted file

# you can simply generate a file with a wrong extension
dfgen --type jpg --output image.gif

# you can also generate a file with an invalid signature
dfgen --type jpg --corrupt-signature invalid # this will replace the 4 first bytes with 0x00 0x01 0x02 0x03

Generate a file with a specified size

# generate a file of 1.4 mb
dfgen --type jpg --file-size 1400000

# or
dfgen --type jpg --file-size 1.4mb

License

MIT

Versions

Current Tags

  • Version
    Downloads (Last 7 Days)
    • Tag
  • 0.5.7
    1
    • latest

Version History

Package Sidebar

Install

npm i dfgen

Weekly Downloads

0

Version

0.5.7

License

MIT

Unpacked Size

12.2 kB

Total Files

12

Last publish

Collaborators

  • okn