A lightweight CLI tool for generating fake test data in CSV, JSON, and XML formats.
Built with Node.js and TypeScript.
Generate realistic test data in seconds with customizable headers, automatic data type inference, and multiple export formats.
- Generate fake data from an example line
- Automatically infers data types:
string,email,date,integer,url,UUID,char,boolean - Supports headers for CSV, JSON (object array), and XML
- Export to multiple formats:
CSV,JSON,XML - Custom output path support for exports
- Clear terminal and show available commands
- Interactive CLI with colored commands for easy usage
npm installRuns the CLI directly using ts-node (requires TypeScript installed):
npm run devCompile the TypeScript code to JavaScript in the dist/ folder and start the CLI:
npm startYou'll see a welcome message and available commands.
- npm run build only compiles the TypeScript code without running the CLI.
- The compiled files will be output to the dist/ folder.
| Command | Description |
|---|---|
Generate |
Starts the fake data generation flow. You will be asked for: - An example data line - Whether to add headers (optional) - Number of rows to generate |
Export <format> <filename> [--path <directory>] |
Exports the last generated data to a file. Supported formats: csv, json, xml. Example: Export csv users --path ./output |
Clear |
Clears the terminal output and shows available commands again |
Help |
Displays this help screen with command usage details |
Exit |
Exits the application |
> Generate
Please enter an example data line:
> John, 28.02.1996, john.doe@email.com, 1234, http://example.com
Would you like to add headers? (y/n)
> y
Enter headers separated by commas:
> name, birthdate, email, id, website
How many rows of data would you like to generate?
> 10> Export csv users --path ./exports
✔ CSV file created successfully: /exports/users.csv
> Export json users
✔ JSON file created successfully: /exports/users.json
> Export xml users
✔ XML file created successfully: /exports/users.xml> Clear> Help
- Data types are inferred automatically from your example line
- Supported date formats:
DD.MM.YYYY,DD/MM/YYYY - Header count must match the number of fields in the example data
- If headers are provided:
- CSV will include a header row
- JSON will be exported as an array of objects
- XML fields will include
nameattributes
├─ src/
│ ├─ cli/
│ │ ├─ clear.ts
│ │ ├─ commandsText.ts
│ │ ├─ help.ts
│ │ ├─ welcome.ts
│ ├─ core/
│ │ ├─ generateData.ts
│ │ └─ inferSchema.ts
│ ├─ exporters/
│ │ ├─ csvExporter.ts
│ │ ├─ jsonExporter.ts
│ │ └─ xmlExporter.ts
│ ├─ input/
│ │ └─ prompt.ts
│ ├─ store/
│ │ └─ dataStore.ts
│ ├─ types/
│ │ └─ schema.ts
│ │ └─ state.ts
│ ├─ utils/
│ │ └─ applyHeaders.ts
│ │ └─ fileUtils.ts
│ └─ app.ts
│ └─ index.ts
MIT License