This script generates a JSON file containing fake data based on a given JSON structure using Node.js and the Faker library.
- Node.js
-
Clone the repository or download the
generateFakeData.js
script. -
Install the required dependencies:
npm init -y npm install faker
-
Customize the json structure and
numEntries
variables in thegenerateFakeData.js
script to match your desired JSON structure and the number of entries you want to create.const fakeData = { // Your JSON structure here, include the properly faker function, // more info in https://fakerjs.dev/api/ }; const numEntries = 100; // The number of entries you want to create
-
Run the script:
node generateFakeData.js
This will generate a fakeData.json
file with the fake data based on your specified JSON structure and the number of entries.
This project is MIT licensed.