A simple and customizable tool for generating mock data for your projects.
- Define schemas for mock data generation.
- Supports various data types using
faker.js
. - Generate multiple records with ease.
- Validates schemas to prevent errors.
Install the package via npm:
npm install mock-quick
In the js file:
const { createMockData } = require('mock-quick');
const schema = {
name: { category: 'name', method: 'firstName' },
email: { category: 'internet', method: 'email' },
};
const data = createMockData(schema, 3);
console.log(data);
Output:
[
{ "name": "John", "email": "john.doe@example.com" },
{ "name": "Jane", "email": "jane.doe@example.com" },
{ "name": "Alice", "email": "alice.doe@example.com" }
]