Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

125
Vistas
Is there a new form of the contextualCard feature in faker.js

I haven't used faker since the wipe and am not familiar with the current form of it. Is there a function similar to the contextual card function in the new version? or a function to create fake usernames? my current code looks like this

useEffect(() => {
  const suggestions = [...Array(20)].map((_, i) =>({
    ...faker.helpers.contextualCard(), 
    id:i,
  }));

  console.log(suggestions);
}, []);

Anything helps. Thanks!

about 4 years ago · Santiago Gelvez
2 Respuestas
Responde la pregunta

0

Thanks for your answer Matt! the easier operation for me was to download the older version of faker using npm install faker@6.0.0.

about 4 years ago · Santiago Gelvez Denunciar

0

Wow, that's from Sonny Sangha Instagram's video? I'm with the same problem here and after searching some issues in Faker Github, it looks that they turned it deprecated, so you should make your own method to get your specifics objects. I saw an example on their readme:

import { faker } from '@faker-js/faker';
// import { faker } from '@faker-js/faker/locale/de';

export const USERS: User[] = [];

export function createRandomUser(): User {
  return {
    userId: faker.datatype.uuid(),
    username: faker.internet.userName(),
    email: faker.internet.email(),
    avatar: faker.image.avatar(),
    password: faker.internet.password(),
    birthdate: faker.date.birthdate(),
    registeredAt: faker.date.past(),
  };
}

Array.from({ length: 10 }).forEach(() => {
  USERS.push(createRandomUser());
});
about 4 years ago · Santiago Gelvez Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda