Skip to main content

Usage with Static Data

What if I already have my data?

simply have generator function map over exisiting Array as shown below with JSON data

import { mocq } from "mocq";
import jsonData from './data.json';

const { generate } = mocq({
nodes: {
generator: (i) => jsonData[i],
count: jsonData.length,
}
});

const { data: { nodes } } = generate();