How to use the animal function from faker

Find comprehensive JavaScript faker.animal code examples handpicked from public code repositorys.

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,
fork icon0
star icon0
watch icon0

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(),
  });
}
fork icon0
star icon0
watch icon0

+ 2 other calls in file