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

Science module #944

Closed
import-brain opened this issue May 11, 2022 · 7 comments · Fixed by #1014
Closed

Science module #944

import-brain opened this issue May 11, 2022 · 7 comments · Fixed by #1014
Labels
c: feature Request for new feature p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision

Comments

@import-brain
Copy link
Member

import-brain commented May 11, 2022

Clear and concise description of the problem

I think it would be a good idea to add a science module to Faker to generate random scientific data. See below for examples.

Suggested solution

Create a new module called science

faker.science.elementName() // "Lithium"
faker.science.elementSymbol() // "F"
faker.science.siUnit() // "kg"
faker.science.siUnit({ long: true, plural: false }) // "meter"

Alternative

No response

Additional context

No response

@import-brain import-brain added c: feature Request for new feature p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision labels May 11, 2022
@Shinigami92
Copy link
Member

From my side, sounds interesting 🤔
I also thought about faker.aws.region() but this would be another issue 🙂

@import-brain
Copy link
Member Author

import-brain commented May 12, 2022

From my side, sounds interesting 🤔 I also thought about faker.aws.region() but this would be another issue 🙂

faker.aws.region() would be interesting, but shouldn't we call the module faker.cloud? That module would have a bunch of cloud-related stuff. Or, maybe we could implement a new module called faker.dev, with a bunch of dev stuff in it?

Edit: Or consolidate everything under faker.internet

@ST-DDT
Copy link
Member

ST-DDT commented May 12, 2022

IMO this discussion is off topic. Please open a new dedicated issue for that.

@import-brain
Copy link
Member Author

@Shinigami92 Can you please create that issue? It's your idea, haha

Now that we're back on track, I would like some input from @faker-js/maintainers and/or @faker-js/members about this proposal. Thanks :)

@ST-DDT
Copy link
Member

ST-DDT commented May 12, 2022

The elementNames might be useful, but I'm not sure when you would need a random unit, usually the unit is fixed and the value is dynamic. But I'm not really against it.

@pkuczynski
Copy link
Member

Sounds fine to me. Although I would probably do faker.science.element and return a hash, so people could use it like this:

faker.science.element().name
faker.science.element().symbol

Why? Because they might need both, symbol and name at the same time...

And for units, I would just call it faker.science.unit...

@import-brain
Copy link
Member Author

Sounds fine to me. Although I would probably do faker.science.element and return a hash, so people could use it like this:

faker.science.element().name
faker.science.element().symbol

Why? Because they might need both, symbol and name at the same time...

And for units, I would just call it faker.science.unit...

Yeah, these names you suggested are much better than what I thought of, thanks for the input!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c: feature Request for new feature p: 1-normal Nothing urgent s: needs decision Needs team/maintainer decision
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants