在生产环境中使用fakerjs安全吗?或者有没有其他替代品?

huangapple go评论53阅读模式
英文:

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

问题

我正在使用fakerjs来测试我的React应用程序。

一些随机函数,比如生成随机颜色、头像或数字,非常有用。我想在生产业务逻辑中也使用这些随机函数。这样做安全吗?

还是我应该只是将代码从存储库复制到我的自己的代码中?

还有没有其他安全用于生成随机值的替代方法?

英文:

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?

答案1

得分: 2

尽管过去关于 Faker 存在争议(链接),但 Faker.js 现在是一个由社区控制的项目,可以安全使用。

链接:

英文:

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

Links:

答案2

得分: 1

I just built one of my projects 2 times.

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

在生产环境中使用fakerjs安全吗?或者有没有其他替代品?

第二次它的大小增加了超过2.5MB

import cost vs extension也表明如此

在生产环境中使用fakerjs安全吗?或者有没有其他替代品?

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

英文:

I just built one of my projects 2 times.

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

在生产环境中使用fakerjs安全吗?或者有没有其他替代品?

2nd time it gets bigger more than 2.5MB

import cost vs extension also says that

在生产环境中使用fakerjs安全吗?或者有没有其他替代品?

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

huangapple
  • 本文由 发表于 2023年7月18日 11:30:26
  • 转载请务必保留本文链接:https://go.coder-hub.com/76709366.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定