skip to Main Content

I’m using fakerjs for testing my React app.

Some of the random function like generating random colors or avatars or numbers are very useful. I’d like to use these random functions in production bussiness logic too.
Is it safe to do that?

Or should I just copy the codes from the repo to my own codes?

Or is there any alternative for generating random values that safe to use in production?

2

Answers


  1. Although there was controversies around Faker in the past (Link), Faker.js is now a community controlled project and is safe to use.

    Links:

    Login or Signup to reply.
  2. I just built one of my projects 2 times.

    1. without including faker.js
    2. including faker.js

    enter image description here

    2nd time it gets bigger more than 2.5MB

    import cost vs extension also says that

    enter image description here

    So, I would like to copy the relevant code from the repo.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search