Is it safe to use fakerjs in production? Or any alternative?

364 Views Asked by At

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

There are 2 best solutions below

0
On BEST ANSWER

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.

0
On

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

Links: