diff options
| author | conner-c <[email protected]> | 2022-12-07 14:35:15 -0600 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-12-07 20:35:15 +0000 |
| commit | d0ff3fecc5e6eba355f64d11eca4549a405386c4 (patch) | |
| tree | 1290481432123571c00f01f86f11c9398bdd4025 /README.md | |
| parent | f06126a1ba8515d6e0b7733999d5cd2f8849be7a (diff) | |
| download | faker-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 'README.md')
| -rw-r--r-- | README.md | 6 |
1 files changed, 6 insertions, 0 deletions
@@ -65,6 +65,12 @@ Array.from({ length: 10 }).forEach(() => { }); ``` +The above code indicates a basic usage of Faker. +The point of interest is the import statements at the top. +The first import indicates how one can import the entirety of Faker, which includes every local, while the commented-out import showcases how to import only a single local. +In most situations, importing a single local is preferable for performance because some testing frameworks reload imports for every test file, which causes startup latencies to add up quickly. +Thus, limiting the import to a single locale can speed up startup times. + ## 💎 Modules An in-depth overview of the API methods is available in the [documentation](https://fakerjs.dev/guide/). |
