diff options
| author | Jess <[email protected]> | 2022-01-12 19:48:48 -0500 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-12 19:48:48 -0500 |
| commit | 71e902599651b645cdb6996c8cd562e8007a32ea (patch) | |
| tree | 368e83ffbeb836d5c66ad7af53c765c7444a26cb /docs/guide | |
| parent | a590f266e02d8f8a2cac65cb6e8bd395bf04074b (diff) | |
| download | faker-71e902599651b645cdb6996c8cd562e8007a32ea.tar.xz faker-71e902599651b645cdb6996c8cd562e8007a32ea.zip | |
feat: adding documentation with vitepress (#80)
Diffstat (limited to 'docs/guide')
| -rw-r--r-- | docs/guide/index.md | 64 | ||||
| -rw-r--r-- | docs/guide/recent-faqs.md | 52 |
2 files changed, 116 insertions, 0 deletions
diff --git a/docs/guide/index.md b/docs/guide/index.md new file mode 100644 index 00000000..18f6c87d --- /dev/null +++ b/docs/guide/index.md @@ -0,0 +1,64 @@ +# Getting Started + +## Overview + +Faker is a popular library that generates fake (but reasonable) data that can be used for things such as: + +- Unit Testing +- Performance Testing +- Building Demos +- Working without a completed backend + +Faker was originally written in [Perl](https://metacpan.org/dist/Data-Faker) and this is the JavaScript port. Language bindings also exist for [Ruby](https://github.com/faker-ruby/faker), [Java](https://github.com/DiUS/java-faker), and [Python](https://github.com/joke2k/faker). + +This documentation only covers the JavaScript implementation of Faker. + +## Environments + +You can run Faker in the Browser, within Node, or the many other languages supported by Faker. ([Perl](https://metacpan.org/dist/Data-Faker), [Ruby](https://github.com/faker-ruby/faker), [Java](https://github.com/DiUS/java-faker), and [Python](https://github.com/joke2k/faker)) + +## Installation + +Install it as a Dev Dependency using your favorite package manager. + +```shell +npm install @faker-js/faker --save-dev +``` + +## Usage + +### Node.js + +```js +import faker from 'faker'; + +const randomName = faker.name.findName(); // Rowan Nikolaus +const randomEmail = faker.internet.email(); // [email protected] +const randomCard = faker.helpers.createCard(); // An object representing a random contact card containing many properties +``` + +### Browser + +```html +<script type="text/javascript" src="https://unpkg.com/@faker-js/faker"></script> + +<script> + // Caitlyn Kerluke + const randomName = faker.name.findName(); + + // [email protected] + const randomEmail = faker.internet.email(); + + // An object representing a random contact card + // containing many properties + const randomCard = faker.helpers.createCard(); +</script> +``` + +:::tip Note +Using the browser is great for experimenting 👍. However, due to all of the strings Faker uses to generate fake data, **Faker is a large package**. It's around `1.57 MB` minified. **Please avoid deploying Faker in your web app.** +::: + +## Community + +If you have questions or need help, reach out to the community via Discord and GitHub Discussions. diff --git a/docs/guide/recent-faqs.md b/docs/guide/recent-faqs.md new file mode 100644 index 00000000..89a114b2 --- /dev/null +++ b/docs/guide/recent-faqs.md @@ -0,0 +1,52 @@ +# Recent Statement and FAQs + +_January 11th, 2022_ + +Due to recent events, folks may have some questions or concerns about the future of Faker. + +Here are some answers. + +## What happened? + +In short, the author deleted the original repository in protest against large companies who did not pay him for maintaining Faker. + +In response to all that happened, we have created an entirely new GitHub Organization for the packages and ecosystem under the namespace [faker-js](https://github.com/faker-js). + +:::tip Support Open Source Software + +🙏 Please ask your company to do their part in sponsoring Open Source projects and contributors. + +Seriously, you don't have to sponsor _this_ project, just start having the conversation with your engineering leadership. +::: + +## Are these the official docs? + +**Yes**. This is the official site and documentation for the Faker library. + +## Who maintains Faker now? + +**Faker is now maintained by the organization [faker-js](https://github.com/faker-js)** after the original repository was deleted by the author. + +## My build broke. Help. + +If you have installed `faker` from npm, please uninstall it and migrate to `@faker-js/faker`. Due to the above issues, version 6 of faker.js **does not run** and is why the `@faker-js/faker` package exists. + +We will be releasing a new version shortly. + +**NPM** + +```shell +npm install @faker-js/faker --save-dev +``` + +**Yarn** + +```shell +yarn add @faker-js/faker -D +``` + +**pnpm** + +```shell +pnpm add -D @faker-js/faker +``` |
