https://github.com/marcosrivasr/json-generator
Tool for generate random JSON data to test your apps
https://github.com/marcosrivasr/json-generator
api-sample data-generator json typescript
Last synced: 11 months ago
JSON representation
Tool for generate random JSON data to test your apps
- Host: GitHub
- URL: https://github.com/marcosrivasr/json-generator
- Owner: marcosrivasr
- Created: 2020-07-03T00:39:48.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-13T05:33:32.000Z (over 3 years ago)
- Last Synced: 2025-05-02T14:37:05.350Z (about 1 year ago)
- Topics: api-sample, data-generator, json, typescript
- Language: JavaScript
- Homepage:
- Size: 12.4 MB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# JSON Generator
JSON Generator is a tool to generate sample data in JSON format for testing purposes. It includes a variety of data types to randomly generate and simple iteration configurations to generate massive amounts of data.
## Installation
```console
$ npm install -g mrr-json-generator
```
## Usage
To use the utility you need to create a simple JSON template and specify the properties and data types you want
```javascript
{
"id": "uuid",
"id2": "id",
"id3": "id",
"title": "title",
"text": "paragraph",
"todo": "text",
"name": "first-name",
"city": "city",
"country": "country",
"last-name": "last-name",
"age": "age",
"phone": "phone",
"grade": "decimal",
"price": "price",
"card": "credit-card",
"aniversary": "date",
"color": "choice red blue yellow",
"friends": [
{"repeat": 5},
{
"id": "index",
"name": "first-name",
"last-name": "last-name",
"company": "company",
"email": "email"
}
],
"check-ins":{
"id": "id",
"name": "full-name",
"opened": "date",
"users": [
{"repeat": 5},
{
"id": "uuid",
"index": "index",
"married": "boolean"
}
]
}
}
```
and then execute
```console
$ json -i origin/template.json -o destination/output.json
```