From d4ede3d6d6d036a757b322911354410552d77235 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 21 May 2024 00:25:41 +0200 Subject: [PATCH 1/4] docs: browser console usage guide --- docs/guide/usage.md | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/docs/guide/usage.md b/docs/guide/usage.md index f19721c2569..362a3d731c9 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -26,7 +26,7 @@ const randomEmail = faker.internet.email(); // Kassandra.Haley@erich.biz ::: -For more information about changing and customizing the locales, please refer to our [Localization Guide](localization). +For more information on selecting and customizing a locale, please refer to our [Localization Guide](localization). ## Browser @@ -46,6 +46,17 @@ For more information about changing and customizing the locales, please refer to 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 `> 5 MiB` minified. **Please avoid deploying the full Faker in your web app.** ::: +## Browser Console + +If you want to try it yourself, you can open your browser console via `Ctrl + Shift + J` / `F12`. + +```js +const { faker } = await import('https://esm.sh/@faker-js/faker'); + +const randomName = faker.person.fullName(); // Amber Keebler +const randomEmail = faker.internet.email(); // Norma13@hotmail.com +``` + ## CDN/Deno ```js @@ -56,7 +67,7 @@ const randomEmail = faker.internet.email(); // Tomasa_Ferry14@hotmail.com ``` ::: info Note -It is highly recommended to use version tags when importing libraries in Deno, e.g: `import { faker } from "https://esm.sh/@faker-js/faker@v8.4.0"`. +It is highly recommended to use version tags when importing libraries in Deno, e.g: `import { faker } from "https://esm.sh/@faker-js/faker@v8.4.1"`. ::: ### Alternative CDN links From c9ee4d34b3c6d3e08033c039dcabd010dfa85059 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 28 May 2024 20:45:45 +0200 Subject: [PATCH 2/4] docs: apply suggestions --- docs/guide/usage.md | 29 ++++++++++++++++++----------- test.html | 15 +++++++++++++++ 2 files changed, 33 insertions(+), 11 deletions(-) create mode 100644 test.html diff --git a/docs/guide/usage.md b/docs/guide/usage.md index 362a3d731c9..4acf111ece4 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -30,6 +30,18 @@ For more information on selecting and customizing a locale, please refer to our ## Browser +If you want to try it yourself, you can open your browser console via `Ctrl + Shift + J` / `F12`. + +```js +const { faker } = await import('https://esm.sh/@faker-js/faker'); + +const randomName = faker.person.fullName(); // Amber Keebler +const randomEmail = faker.internet.email(); // Norma13@hotmail.com +``` + +Some websites may have protections against downloading external code, dev servers usually work fine. +As an alternative, you can create a simple html file and open it with your browser: + ```html + + + ``` ::: info 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 `> 5 MiB` minified. **Please avoid deploying the full Faker in your web app.** ::: -## Browser Console - -If you want to try it yourself, you can open your browser console via `Ctrl + Shift + J` / `F12`. - -```js -const { faker } = await import('https://esm.sh/@faker-js/faker'); - -const randomName = faker.person.fullName(); // Amber Keebler -const randomEmail = faker.internet.email(); // Norma13@hotmail.com -``` - ## CDN/Deno ```js diff --git a/test.html b/test.html new file mode 100644 index 00000000000..93b6cb99f63 --- /dev/null +++ b/test.html @@ -0,0 +1,15 @@ + + + + From d3fb5dfd25217fb86ab9bd1e758141b489e764e9 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 28 May 2024 20:50:41 +0200 Subject: [PATCH 3/4] chore: remove test.html --- test.html | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 test.html diff --git a/test.html b/test.html deleted file mode 100644 index 93b6cb99f63..00000000000 --- a/test.html +++ /dev/null @@ -1,15 +0,0 @@ - - - - From 73ff4f9ce6a643f2e82a1485d93e02365c8f1eb2 Mon Sep 17 00:00:00 2001 From: ST-DDT Date: Tue, 28 May 2024 20:52:56 +0200 Subject: [PATCH 4/4] chore: missing words --- docs/guide/usage.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/guide/usage.md b/docs/guide/usage.md index 4acf111ece4..c9197479183 100644 --- a/docs/guide/usage.md +++ b/docs/guide/usage.md @@ -61,7 +61,7 @@ As an alternative, you can create a simple html file and open it with your brows ``` ::: info 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 `> 5 MiB` minified. **Please avoid deploying the full Faker in your web app.** +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 `> 5 MiB` minified. **Please avoid deploying the full Faker package in your web app.** ::: ## CDN/Deno