Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to put parameters to faker functions? #57

Open
Studenich opened this issue Feb 13, 2024 · 1 comment
Open

How to put parameters to faker functions? #57

Studenich opened this issue Feb 13, 2024 · 1 comment

Comments

@Studenich
Copy link

Trying to send parameter to zipCode function but it can't handle this

Error: faker.address.zipCode('#####') is not a function

@JargeZ
Copy link

JargeZ commented Apr 17, 2024

# path may vary depends on your base docker image
const faker = require('/usr/local/lib/node_modules/pg-anonymizer/node_modules/faker');

module.exports = {
  generateCity: (val) => {
    # use faker whatever you want
    let city = faker.address.city();
    return city.substring(0, 15);
  }
};

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants