DEV Community 👩‍💻👨‍💻

Hasin Hayder
Hasin Hayder

Posted on

Create Huge Amount of Mock Data from Schema Without Writing a Single Line of Code

Faker.JS is a great tool for creating mock data, and it serves the purpose. However, to create a structured dataset you need to write too much code, and sometimes it gets boring. This is why I have created this project that can automate the mock-data creation process without you writing a single line of code. It was actually created for my personal projects and then I thought that it can add value to many other projects, especially those in need of mock data, and save a lot of time for everyone. Let me show you why this project is a necessary one in your toolkit and how it can be used in this short video tutorial.

Did I tell you that this software is really fast? It can create 1 million records in less than 15 seconds in most cases.

you can even use auto increment values in your schema, just like this one

//schema.mjs
export default {
  // random 20 people with autoincrement id
  output:'./output.json',
  total:20,
  structure:{
    id:'autoIncrement',
    firstName: 'maleFirstName',
    lastName: 'maleLastName',
    email:'emailFromDomain,firstName,lastName,test.com',
    fullName:'joinerSpace,firstName,lastName',
  }
}

Enter fullscreen mode Exit fullscreen mode

The github repository is located at https://github.com/hasinhayder/fake-data-generator-from-schema where you can find some example schemas in the example-schemas directory.

Pull requests, feature suggestions and issues are very welcome.

Top comments (0)

Find what you were looking for? Sign up so you can:

 
🌚 Enable dark mode
🔠 Change your default font
📚 Adjust your experience level to see more relevant content