From d0ff3fecc5e6eba355f64d11eca4549a405386c4 Mon Sep 17 00:00:00 2001 From: conner-c <71367560+conner-c@users.noreply.github.com> Date: Wed, 7 Dec 2022 14:35:15 -0600 Subject: docs: include hints on specifying a locale can help startup time (#1629) Co-authored-by: ST-DDT --- docs/guide/usage.md | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'docs/guide/usage.md') 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(); // Kassandra.Haley@erich.biz ``` +:::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 -- cgit v1.2.3