How to use the animal function from faker
Find comprehensive JavaScript faker.animal code examples handpicked from public code repositorys.
GitHub: calrays/lumiscope
10 11 12 13 14 15 16 17 18 19 20 21
const generateAnimals = () => { const animals = []; for (let i = 0; i < SET_SIZE; i++) { const skipImgEvery = 4; const animalType = faker.animal.type(); const name = `${faker.commerce.color()} ${faker.animal[animalType]()}`; const animal = { type: DATA_TYPES.animal,
0
0
0
18 19 20 21 22 23 24 25 26 27
const animals = []; const {size} = req.query; const limit = size || 2 for (let i = 0; i < limit; i++) { animals.push({ dog: faker.animal.dog(), cat: faker.animal.cat(), rabbit: faker.animal.rabbit(), }); }
0
0
0
+ 2 other calls in file
faker.random is the most popular function in faker (1352 examples)