aboutsummaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorconner-c <[email protected]>2022-12-07 14:35:15 -0600
committerGitHub <[email protected]>2022-12-07 20:35:15 +0000
commitd0ff3fecc5e6eba355f64d11eca4549a405386c4 (patch)
tree1290481432123571c00f01f86f11c9398bdd4025 /docs
parentf06126a1ba8515d6e0b7733999d5cd2f8849be7a (diff)
downloadfaker-d0ff3fecc5e6eba355f64d11eca4549a405386c4.tar.xz
faker-d0ff3fecc5e6eba355f64d11eca4549a405386c4.zip
docs: include hints on specifying a locale can help startup time (#1629)
Co-authored-by: ST-DDT <[email protected]>
Diffstat (limited to 'docs')
-rw-r--r--docs/guide/localization.md5
-rw-r--r--docs/guide/usage.md9
2 files changed, 13 insertions, 1 deletions
diff --git a/docs/guide/localization.md b/docs/guide/localization.md
index f6858378..1412ec00 100644
--- a/docs/guide/localization.md
+++ b/docs/guide/localization.md
@@ -28,6 +28,11 @@ The English locales are around 600 KB in size.
All locales together are around 5 MB in size.
:::
+:::tip Note
+Some locales have limited coverage and rely more heavily on the English locale as the source for features they currently do not have.
+However, in most cases, using a specific locale will be beneficial in the long term as specifying a locale reduces the time necessary for startup, which has a compounding effect on testing frameworks that reload the imports every execution.
+:::
+
## Available locales
<!-- LOCALES-AUTO-GENERATED-START -->
diff --git a/docs/guide/usage.md b/docs/guide/usage.md
index 63a0c183..6d325a0b 100644
--- a/docs/guide/usage.md
+++ b/docs/guide/usage.md
@@ -6,11 +6,18 @@ Using Faker is as easy as importing it from `@faker-js/faker`.
```js
import { faker } from '@faker-js/faker';
-
+// or, if desiring only a specific locale
+// import { faker } from '@faker-js/faker/locale/de'
const randomName = faker.person.fullName(); // Rowan Nikolaus
const randomEmail = faker.internet.email(); // [email protected]
```
+:::tip Note
+Using the first import statement will load every locale into memory.
+As such, start-up times and performance may be slow.
+Thus, by declaring a locale in the import, one can increase performance and reduce the time on start-up.
+:::
+
Or if you're using CommonJS:
```js